{"id":7666111,"date":"2020-12-15T10:11:29","date_gmt":"2020-12-15T10:11:29","guid":{"rendered":"https:\/\/wpml.org\/?post_type=faq&#038;p=7666111"},"modified":"2025-02-12T12:37:29","modified_gmt":"2025-02-12T12:37:29","slug":"how-to-generate-a-po-file-for-a-plugin-or-a-theme","status":"publish","type":"faq","link":"https:\/\/wpml.org\/zh-hans\/faq\/how-to-generate-a-po-file-for-a-plugin-or-a-theme\/","title":{"rendered":"How can I generate a PO file for a plugin or theme?"},"content":{"rendered":"\n<p class=\"lead\">You can use the Theme and plugins localization feature in WPML to generate a PO file that contains a list of all translatable text in a plugin or theme.<\/p>\n\n\n\n<p>To get started, make sure you have the WPML and WPML String Translation plugins installed on your site.&nbsp;<\/p>\n\n\n\n<p>To generate a <strong>.po<\/strong> file for a theme or plugin:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to <strong>WPML \u2192 Theme and plugins localization<\/strong> and select the theme or plugin you want to generate a PO file for.<\/li>\n\n\n\n<li>Click to scan the selected components for strings.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic tb-image-frame-none aligncenter\" data-toolset-blocks-image=\"fefe1742242eda6312697c702f8e41d3\"><a href=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin.png\"><img decoding=\"async\" width=\"1024\" height=\"548\" loading=\"lazy\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-1024x548.png\" alt=\"\" class=\"wp-image-16037580\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-1024x548.png 1024w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-300x161.png 300w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-150x80.png 150w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-768x411.png 768w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-1536x822.png 1536w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-scanning-theme-or-plugin-2048x1096.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption><div class=\"tb-image-caption\">Selecting a theme or plugin and scanning it for strings<span id=\"docs-internal-guid-379ec240-7fff-4f25-b724-1e28b769bf26\"><div><span style=\"font-size: 11pt; font-family: Arial, sans-serif; color: rgb(0, 0, 0); background-color: transparent; font-style: italic; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; vertical-align: baseline;\"><\/span><\/div><\/span><\/div><\/figcaption><\/figure>\n<\/div>\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Once the scanning finishes, click the <strong>download<\/strong> icon next to the theme or plugin.<\/li>\n<\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\" tb-image tb-image-dynamic tb-image-frame-none aligncenter\" data-toolset-blocks-image=\"c4946e46c27fc20ba124c17eb9d84a2e\"><a href=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file.png\"><img decoding=\"async\" width=\"1024\" height=\"528\" loading=\"lazy\" src=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file-1024x528.png\" alt=\"\" class=\"wp-image-16037625\" srcset=\"https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file-1024x528.png 1024w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file-300x155.png 300w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file-150x77.png 150w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file-768x396.png 768w, https:\/\/wpml.org\/wp-content\/uploads\/2024\/08\/wpml-theme-plugin-localization-download-po-file.png 1440w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption><div class=\"tb-image-caption\">Downloading the .po file generated by WPML<span id=\"docs-internal-guid-80a40a8d-7fff-25b9-b41e-5ccd95ae4401\"><span style=\"font-size: 11pt; font-family: Arial, sans-serif; color: rgb(0, 0, 0); background-color: transparent; font-style: italic; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-alternates: normal; font-variant-position: normal; vertical-align: baseline;\"><\/span><\/span><\/div><\/figcaption><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>You can generate a PO file for a plugin or theme by using the Theme and plugins localization feature in WPML. <\/p>\n","protected":false},"author":228164,"featured_media":0,"menu_order":50,"template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_uag_custom_page_level_css":"","ep_exclude_from_search":false,"footnotes":""},"faq-category":[26137],"class_list":["post-7666111","faq","type-faq","status-publish","hentry","faq-category-how-to"],"spectra_custom_meta":{"_subscription_coupon_product_id":["0"],"_wpml_word_count":["133"],"_wpv_contains_gutenberg_views":[""],"_views_template":["0"],"_edit_lock":["1739363857:777903"],"_edit_last":["777903"],"_wpml_media_featured":["1"],"_wpml_media_duplicate":["1"],"_alp_processed":["1739363851"],"_wpml_location_migration_done":["1"],"_yoast_wpseo_content_score":["90"],"faq_order":["5"],"wpcf-faq-category":["6"],"_oembed_4ba9cd2220e447854339cd9ed2c0e9c3":["{{unknown}}"],"_oembed_8f7288ccd1228336cd0cbad12f165507":["{{unknown}}"],"_oembed_085e890236af876c824fa92e59328670":["<iframe title=\"Translating Menus in WPML\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/aFQuEGQs19c?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_085e890236af876c824fa92e59328670":["1627704489"],"_oembed_9596c0d9095e7ce9cc90624324ef4422":["<iframe title=\"Duplicator For WordPress Quick Overview\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/yZ7pHmR9JC8?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_9596c0d9095e7ce9cc90624324ef4422":["1644232586"],"_oembed_12570cf8030926800bac0f1584e1e153":["<iframe title=\"How to use the backup wizard in cpanel\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/eS-tCkc-gm0?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_12570cf8030926800bac0f1584e1e153":["1644232586"],"_oembed_1c0ef2e069ab1e666be8a1bac83a42ee":["{{unknown}}"],"_oembed_e9018e6807d31b4505b7ad464275fdce":["<iframe title=\"How to copy multiple accounts from another server to your WHM server using SSH\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/C6ro9h0qowU?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_e9018e6807d31b4505b7ad464275fdce":["1644232586"],"_oembed_9052213bd50132682bbabb79e50bace9":["<iframe title=\"How to use FTP to upload files to WordPress for Beginners\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/_nDQz1JQfYA?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_9052213bd50132682bbabb79e50bace9":["1644232586"],"_oembed_cfcc8d32f359dd000173b240cccb4392":["{{unknown}}"],"_yoast_wpseo_estimated-reading-time-minutes":[""],"_yoast_wpseo_wordproof_timestamp":[""],"_yoast_wpseo_primary_faq-category":["26137"],"toolset_post_editor_mode":["classic","classic"],"cmplz_hide_cookiebanner":[""],"_yoast_wpseo_metadesc":["Learn how to use the Theme and plugins localization feature in WPML to generate a PO file with a list of all translatable text."],"_uag_css_file_name":["uag-css-7666111.css"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false},"uagb_author_info":{"display_name":"Kruno Golubi\u0107","author_link":"https:\/\/wpml.org\/zh-hans\/author\/kruno-g\/"},"uagb_comment_info":0,"uagb_excerpt":"You can generate a PO file for a plugin or theme by usi...","_links":{"self":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/faq\/7666111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/users\/228164"}],"version-history":[{"count":8,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/faq\/7666111\/revisions"}],"predecessor-version":[{"id":16690075,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/faq\/7666111\/revisions\/16690075"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/media?parent=7666111"}],"wp:term":[{"taxonomy":"faq-category","embeddable":true,"href":"https:\/\/wpml.org\/zh-hans\/wp-json\/wp\/v2\/faq-category?post=7666111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}