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 you are trying to translate your favorite plugin or theme into other languages, we have multiple choices.
0 Comments
Leave a Reply. |