Translating the theme

From Graphene Theme Documentation
Jump to: navigation, search

Instructions

Prerequisites

Make sure you have a copy of the theme on your computer.

  • You would need to have a site (either in localhost or on your server) with the theme installed so that you can test the translation.
  • Configure your WordPress site to run in the language you are translating the theme for. For more information, see Installing WordPress in Your Language.
  • Go to the POEdit website and download the latest version of POEdit. This free, open-source software will make the translation process a whole lot easier.
  • Install POEdit, and run the program.

Creating the translation file

If a translation is already available for your language, skip this section and jump straight to the Editing existing translation section.

  1. In POEdit, click File > New catalog from POT file... . Then, browse to the graphene/languages folder and select the graphene.pot file, and click Open.
  2. A Settings window should pop up in POEdit. Fill up the Project Info tab with the appropriate info. You can ignore the other two tabs (Paths and Keywords), as these have already been setup for you in that graphene.pot file. Then click OK.
  3. Another pop-up should appear asking you where to save the file. Save it in the graphene/languages folder, and give it the specific name for the language you're translating the theme into. WordPress uses specific strings to identify languages, which you can find out in the WordPress in Your Language Codex page. For example, French language translation file should be named fr_FR.po, whereas the German translation file should be named de_DE.po.
  4. You're now all set up and can begin translating! See the screenshot at the end of this page for a quick view of what's where.

Note that you don't have to translate all the strings at one go. You can just save at any point in the translation process, and pick up where you left afterwards.

Editing existing translation

If there's already a translation available for your language, it's much better to continue with editing the existing language file rather than creating a new one. This way, you can just translate the new strings that haven't been translated, and not re-translate all the other strings.

  1. Open up the existing language file in POEdit. Note that you can only open the .po file with POEdit. The .mo file is generated by POEdit from the .po file. It is a machine object file which is not human-readable.
  2. In POEdit, click Catalog > Update from POT file... . Then, browse to the graphene/languages folder and select the graphene.pot file, and click Open. This will update your translation file with the latest strings from the theme.
  3. You're now all set up and can continue the translation! See the screenshot at the end of this page for a quick view of what's where.

Note that you don't have to translate all the strings at one go. You can just save at any point in the translation process, and pick up where you left afterwards.

Screenshot

POEdit-screen.png