Article sections

    In this article I show you how to translate LEVELUP theme using Poedit.
    But first of all is important to know what are .POT, .PO and .MO files. WordPress uses the GNU gettext localization framework for translation. There are three types of files used in the framework:

    POT (Portable Object Template) files: The first step in the translation process is using a program to search through the WordPress source code to pick out text passed into a __() or __e() function, generating a POT file. This file will contain all the text available for translation.
    PO (Portable Object) files: The second step involves translating the text in a POT file into the target language, saving both English and translator messages in a PO file.
    MO (Machine Object) files: In the last step, the PO file is converted into a machine readable format.

    Translating Using Poedit
    1. Install Poedit.
    Poedit available for Mac OS X, Windows and UNIX/Linux.

    2. Open Poedit and select Create new translation.

    3. Select the .POT file from the LEVELUP theme to translate which (you can find the files in the wp-content/themes/levelup/languages/levelup.pot folder).

    4. A box will pop up asking for language of the translation. Select your language.

    4. After you hit “OK,” you’ll be asked what you want to name your translation file. The name is important and there’s a particular format you will need to follow. For example, if you’re translating Italian for Italy, the file should be name it_It.po. Check out the GNU `gettext’ utilities to find your language and country codes.

    5. Save your file in your computer.

    6. Now you can start translating your theme. Poedit has a simple and straight forward interface that doesn’t involve a steep learning curve. The space at the top will display all the text ready to translate, and any completed translations will display to the right. The boxes underneath show the source text you’ve selected to translate, your translation and any notes for translators.

    Translating a line of text is really easy – just select a word or phrase, enter your translation.

    7. When you’ve finishing translating, simply save your file. Poedit will automatically create both .po and .mo files in theme’s languages folder.

    in Troubleshooting
    Did this article answer your question?