Problem with Language translation

You shouldn’t be editing the core translation files to translate a plug-in or theme. Here’s a (not so brief) run-down of how translations of plug-ins and themes work….

When a theme or plug-in wants to allow some text to be translated it wraps it inside a function like

__('This text can be translated','my-theme-or-plugin');

Translation functions

First of all, only text inside such functions will be able to be translated, as its these bits of text that WordPress recognizes can be translated. So first of all you must check that something like the following is present in the theme code:

__('Be nice!','my-theme-or-plugin');

Translation domains

Second of all, notice the my-theme-or-plugin. This is the theme’s (or plug-in’s) domain. It must be registered somewhere, to some location (inside the theme’s folder). This is where WordPress looks to translate the string. If it is blank, it will use the core translation files (e.g. es_ES.mo) that are (when added) inside the language directory of the wp-contents directory. Themes should have their own domain and not rely on the core translation files (at least for strings that don’t appear in the those files).

What this means is that if you translate a plug-in or theme you need to know their domain (e.g. my-theme-or-plugin) and you save your po/mo files as:

my-theme-or-plugin-{language extension}.mo/.po

For example: my-theme-or-plugin-es_ES.mo and my-theme-or-plugin-es_ES.po. These must be placed in the theme’s / plug-ins registered area.

In short to translate a theme / plug-in you need to know:

  1. It’s domain (see Codex)
  2. Where to put the po/mo files

You should not need to edit the ‘core’ language files: e.g. es_ES.po/es_ES.mo

Usually plug-ins and themes will provide a translation template file (sometimes POT), this is a list of strings the plug-in/theme allows to be translated. You can use this to create your my-theme-or-plugin-es_ES.mo/.po files and save it in the appropriate place.

You will have to contact the theme/plug-in author directly for the above information.