![]() ![]() Once we click save, PoEdit software will automatically generate. Same way, the text domain for the theme can be found in the theme’s style.css file. The text domain of any plugin(if it’s translatable) can be found in the main plugin file. If the text domain is ‘my-plugin’, the German MO and PO files should be named my-plugin-de_DE.mo and my-plugin-de_DE.po. For example, the locale for German is de_DE. If your plugin text-domain is my-plugin, the translated file is to be saved as my-plugin-.mo. The format should be plugin-text-domain-language_code. Confirm that we saved the file in the correct format. ![]() Once done, click File > Save As menu in the software.ĥ. Once we selected our language, we can now begin the translation. For the list of language codes WordPress uses, please click this LINK: ( ).Ĥ. We have to follow the same practices & otherwise the translation won’t work. Note: WordPress uses a language code for each & every language. Choose the language the plugin to be translated into. Locate the POT file of the Plugin you wish to translate.ģ. Open the Poedit Software & Create New TranslationĢ. If both prerequisites are ready & you got a basic idea about the terms used in the translation steps, we can start the translation.ġ. So our process aim is to create MO files & PO files from plugin POT files using Poedit software. ![]() So the workflow is POT (original strings) to PO (original strings and their translations to a specific language) to MO (compiled binary results). POT file is used whenever someone starts a new PO file for translation to a new language. It is typically used to translate program code and may be loaded or imported into the GNU gettext program. MO files: MO or Machine Object is a binary data file that contains object data referenced by a program. For example, for French, there would be a fr.po file, for German, there would be a de.po, and for American English, there might be en-US.po. PO files: PO files are the files which contain the actual translations. The plugin or theme developer has to provide this file to us. A POT file is essentially an empty PO file without the translations, with just the original strings. They will have all the translation strings left empty. POT file: POT files are the template files for PO files. The POT file will be available in the `language` directory of your plugin or theme.īefore beginning, it is better to know about some terms used in this step. The free version is enough for our translation purpose. The software is available on the software website ( ) for all operating systems. We have to install Poedit software on our computer.In this article, we are going to briefly explain how we can translate our WordPress plugins or theme into other language using one popular gettext translation tool called Poedit.īefore beginning translation, we need the following: If your plugin supports WordPress versions older than 4.6 (you define this with the Requires at least directive in the readme.txt file of the plugin) you should also declare the text domain and the relative path to the translation files with the load_plugin_textdomain() WordPress function.If you are trying to translate your favorite plugin or theme into other languages, we have multiple choices. The resulting plugin header with our example-plugin text domain: /* * Plugin Name: Example Plugin * Author: Plugin Author * Text Domain: example-plugin */ An exception for plugins compatible with old WordPress versions Its value should match the plugin slug, namely the unique portion of the plugin URL.Īs an example, in a plugin available at the correct value of the text domain is example-plugin. More specifically, the text domain is an identifier used by WordPress to categorize the loaded translations. The first step for making your plugin hosted on translatable is to declare the text domain in the plugin header. Declare the text domain in the plugin header This section will cover the method used to make a plugin hosted on the repository translatable. Make a WordPress plugin hosted on translatable With a translatable WordPress plugin, you can cover a more extensive user base for your plugin hosted on or sell more licenses in marketplaces like Envato Market. In this tutorial, you will learn how to make a WordPress plugin translatable. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |