How do we add language support using .pot and .mo files in a WordPress theme? And how we retrieve the theme?
|
The .po (Portable Object) file is like a small library containing all the English terms in the theme with an empty column for non-English translations. Using software like Poedit, the .po file can be opened, translations can be added, and it can be saved, which also generates the .mo (Machine Object) file. With a suitably localized theme, the steps involved in translating it are:
Open Source Software Needed for the translation process: Poedit a cross-platform gettext catalogs (.po files) editor Gettext the GNU `gettext' utilities are a set of tools that provides a framework to help other GNU packages produce multi-lingual messages. A complete guide and tutorial on translating WordPress themes can be found on Urban Giraffe |
|||
|
|
|
My first recommendation would be to read this article in the WordPress Codex. To add language support, the first thing you need to do is make sure all of your echoed content is passed through a filter that can handle internationalization (i.e From there, you'll use an external tool to parse all of your content for translatable strings, translate them, and save the appropriate language files. Full instructions and a list of resources are available on the codex article I linked to above. |
|||
|
|