A Simple Guide to Use Internationalization Library
Revision as of 19:29, 4 November 2010 by Ted (Talk | contribs) (New page: Category:Internationalization == Overview == This page focuses on very simple/general steps to bring i18n library up in your project. == Steps == # Choose and create a directory to p...)
Overview
This page focuses on very simple/general steps to bring i18n library up in your project.
Steps
- Choose and create a directory to put exported translated files (*.mo).
- In your project, initialize a
{LOCALE_MANAGER}
using the dir created in step 1. - Write normal code that uses
{I18N_LOCALE}.translation
or{I18N_LOCALE}.plural_translation
to get translated texts.{I18N_LOCALE}
instances can be queried from{LOCALE_MANAGER}
. - Run po_generation_tool to extract template file (.pot) to be translated.
- Copy the .pot file to .po files with the name of the language you need. For example, es_ES.po for Spanish, ko_KR.po for Korean.
- Translate .po files using external tools like poEdit for Windows and KBabel or gtranslator for KDE and Gnome.
- Export .mo files using the tools above. And copy them into the directory created in step 1.
- Run the executable, you get translated strings at run-time.