Translating Recipe Hero

It’s actually quite easy to translate Recipe Hero – it’s up to you how though.

The wp-config.php stuff

Before we do anything with Recipe Hero, you’ll need to make sure that you’ve defined your language in your site’s wp-config.php file.

Please add the following there, changing it to suit your desired language:

Above I’ve done it for Korean, but you can find your required country code here.

Using include languages

If you open up the recipe-hero plugin folder and look inside the languages folder, you can see all the already-translated languages. If your language is there, after adding the bit of code above, Recipe Hero should now be translated on your site. However, there aren’t many just yet, so you’ll probably need to continue on.

Using Loco Translate

Loco Translate is a WordPress plugin that provides in-browser editing of PO files used for localizing WordPress plugins and themes.

You can then follow the instructions that take you through making a translation.

Using PoEdit

PoEdit is a more advanced alternative to Codestyling Localization. Only advanced users or translators who wish to contribute to Recipe Hero core should attempt this method.

Recipe Hero includes a file called recipe-hero-en_GB.po, inside the languages directory.

Open up the file in PoEdit and go to File > New Catalog from POT File.

Once you’ve done that, choose the recipe-hero-en_GB.po file and open up the Catalog > Properties window, where you can enter in your name, the language you’re translating to, etc.

Screen Shot 2014-11-29 at 10.47.59 am

You should also probably save at this point, naming the file based on your translation’s language, like recipe-hero-ko_KR.php.

Now it’s translation time! Go through each string and add your translation:

Screen Shot 2014-11-29 at 10.51.04 am

When you’re done, make sure to save and then head over to the contact page and send me a copy of your translation (if you’d like). I’ll then include it in the next update so you and everyone else can enjoy it! 🙂

Updating your Translation

After updates, you can update your po file by opening it and then going to Catalog > Update from POT file. Choose the file and it will be updated accordingly.

Transifex

Recipe Hero is actively translated over in the Recipe Hero Transifex Project. All translations completed there will be included in future Recipe Hero updates too.

How Recipe Hero looks for the translation file

This is the order that Recipe Hero will look for the translated file:

  1. WP_LANG_DIR/recipe-hero/recipe-hero-LOCALE.mo
  2. recipe-hero/languages/recipe-hero-LOCALE.mo (which if not found falls back to:)
  3. WP_LANG_DIR/plugins/recipe-hero-LOCALE.mo