Translation

The Procedure

 

  1. For translation you need to use the file with workpiece phrases of Membership plugin – membership-by-supsystic/app/lang/default.poYou can edit it using Poedit, a cross-platform gettext catalogs (.po files) editor.
  2. Duplicate the default.po file and rename it to lang_COUNTRY.po
    • Example for the referenced plugin case: pt_BR.po
      — pt_BR means Portuguese Brazil, but many languages don’t have a country variation…
      — you’ll have to fill in with your own language
    • WPLANG in wp-config.php file must be set to your language, e.g., pt_BR
    • Every time you save in WordPress the .po file, PoEdit automatically generates a .mo file, which is the one WordPress uses and basically the only one you need to upload
  3. Make the translation.
  4. Create a directory supsystic-membership-lang in directory of your theme.
  5. Add the translations (.po and .mo) files to this folder.
  6. Or you can place your files by this path – /wp-content/languages/plugins/. But in this case files should be name like this – membership-by-supsystic-pt_BR.po

 

The Formats

 

  • .mo stands for Machine Object
    — compiled export of the .po file which is used by WordPress
  • .po stands for Portable Object
    — editable text file with the translations strings
    — based on the master .pot file, using Update from POT file PoEdit function
    — some folks distribute this as a master file, but it should be used only for translations
  • .pot stands for Portable Object Template
    — editable text file used to grab all the translatable strings from WordPress itself and Themes and Plugins, using Update from Sources PoEdit function

 

Observations

 

  • If you do a full or a decent partial translation of WordPress Membership plugin, submit it to the plugin author, so he can include it in the Repository and you get credited for it
  • Don’t forget to make a backup of your translation, because if you upgrade the Membership plugin, your file will be lost
Categories
Related Articles
Latest Articles