![]() ![]() Place the MO file into the directory within your plugin that you specify in your call to load_plugin_textdomain(), ie “languages”.Provide the POT file to a translator who returns one or more PO files with the text translated.Extract all translatable strings into a POT file. ![]() Include a call to load_plugin_textdomain() as I describe in my article Writing a Plugin That Can Be Localized by WPML. Code the plugin/theme using the translation functions _('message'), _e('message'), etc.The basic process for translating a plugin or theme is as follows: Extracting Strings for TranslationĪlthough I won’t delve deeply into all aspects of WordPress internationalization (i18n), it is important to note that it’s built on the excellent GNU gettext localization framework. The codex article might be better if you’re translating a plugin that you have listed on, but since the majority of my plugins are either custom for a client or myself, or listed in the WooCommerce shop, I have to do my translation on the command line. Although this is documented in the codex: I18N for WordPress Developers and Translating WordPress, those articles are somewhat lengthy and the first time I was asked to internationalize a plugin it took me some time to find the actual steps to generate my POT file. The purpose of this article is to provide a quick and easy to follow step-by-step guide to extracting text strings from a WordPress plugin for translation from the command line. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |