Translate Drupal from English to Vietnamese with POEdit

Drupal multi language

Drupal support multi language website and user can translate with Locale module. But it have some difficult when you translate a lot text or you need send to customer and they will translated by himself. Export current language to .po file and translate with POEdit is an easy way.

Poedit is cross-platform gettext catalogs (.po files) editor. It is built with wxWidgets toolkit and can run on any platform supported by it (although it was only tested on Unix with GTK+ and Windows). It aims to provide more convenient approach to editing catalogs than launching vi and editing the file by hand.

Steps to do:

  1. Download and install POEdit, it support for both Windows and Mac OS.
  2. Enable Locale module and add Vietnamese language with path "admin/config/regional/language/add"
  3. Download and import translated Vietnamese language here: https://localize.drupal.org/translate/languages/vi
  4. Setup your website and modules.
  5. Export Vietnamese language to .po file
  6. Open with POEdit and ready for translation or send to customer to translate.
  7. Import again to Drupal website after translated.

Notes:

When export with Locale module and open with POEdit i get error: Broken catalog file: singular form msgstr used together with msgid_plural

Here is a solution:

Open file locale.inc store in Drupal folder root/includes, find at line 1711 with Drupal version 7.26

change line

for ($i = 0; $i < $language->plurals; $i++) {

to

for ($i = 0; $i <= $language->plurals; $i++) {

Now you can export .po and open with POEdit without errors

Other posts