Enhanced Meta Widget was recently updated for multilanguage support. The number of languages included depends on the number of people who are willing to translate EMW into their own language.
There are two ways to translate the plugin. One is “down and dirty”, a quick way to translate, but may make it a little more difficult to update. The other is more involved, but can be used to offer translations for other plugins/projects, as well as making it a bit easier to update translations when the plugin is updated.
Advice: If a translated version of WordPress already exists, obtain the .po file for it and use it when translating for EMW to keep terms and phrases consistent. I have added comments to the POT file included with EMW identifying phrases that should already be translated for WordPress at large. And while the exact phrase for EMW may not exist in the WordPress .po file, many of the individual terms are there to help you keep words like “post”, “page”, “link”, etc. consistent throughout. You can find all the different languages in which WorpPress has been released at WordPress in Your Language.
Down and Dirty Method
Take the .pot file included in the distribution. In the file you will find
for every string that needs to be translated. Translated the string in the msgid field and place your translation in the msgstr field (don’t forget the quotation marks). Save the file as “enhanced-meta-widget-your language here.pot” and email the file to me. My email address is in the blog header.
This method uses Poedit to help you create valid translation files. It also makes it easy to update files as necessary when the plugin is updated.
Step 1: Install Poedit
Download and install the latest version of the program from: http://www.poedit.net/. There are versions for Windows, Linux and MacOS so you can work on any platform with it.
Step 2: Creating new translation project
Select ‘Create catalog from POT file’ from the File menu. Select the POT file to be translated, for EMW that is the
enhanced-meta-widget.pot file included with the distribution of this plugin. The program will ask you for the project info, and here you can add info about project, translation langauge and yourself. Please list your name in the
Team: field, and your e-mail address in the
Team's e-mail address: field. Set the language and country and click ok.
You will now be asked to save the catalog. You can use
default.po, but if you save it as
enhanced-meta-widget-"languagecode_countrycode".po you can skip step 4 below. (See step 4 for information on language and country codes and appropriate format of file name.) If the POT file is valid, you will see the list of translation strings. If the POT file is not valid you will get information about errors.
Step 3: Translating
Pretty straightforward. Translate all strings. In Poedit there are two fields below the list of strings to be translated. The top field contains the current string to be translated. Type the translated string in the bottom field.
Important: Don’t translate %s found embedded in the strings for translation, just leave them. They represent another value added by the plugin or theme code.
Once the translation is completed, it needs to be saved with the appropriate name. If you already saved the file with the appropriate name in step 2, just save the project and exit Poedit. If not, keep reading.
Poedit will generated two files, one with MO extension and the other with PO extension. Both files should have the same name, but different extensions obviously.
For EMW, the name of the file is
enhanced-meta-widget-with language and country codes. Here are examples of the proper file names for the French (France) translation:
If there were a translation into French Canadian the files would be named:
Step 5: Updating the translation
If the plugin POT is updated, the translation files will need to be updated. I will state that the POT file has been updated in the release notes if it is updated.
Open the PO file of your translation (i.e.
enhanced-meta-widget-fr_FR.po) in Poedit and select ‘Update from POT file’ from the Catalog menu. Point to the new POT file, and Poedit will show you the new strings to be translated and and them to your translation files. It will also show you any obsolete strings and remove them from your translation files. It will try to recognize the changes and offer you the ‘fuzzy’ translation.
After you have saved your translation files (new or updated), send both the *.po and *.mo files to me by e-mail and I’ll update the plugin distribution. E-mail address is email@example.com.