Difference between revisions of "A Simple Guide to Use Internationalization Library"

m
 
Line 13: Line 13:
 
# Export .mo files using the tools above. And copy them into the directory created in step 1.
 
# 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.
 
# Run the executable, you get translated strings at run-time.
 +
 +
 +
==Process Diagram==
 +
 +
[[Image:I18n process diagram.png]]

Latest revision as of 07:18, 27 February 2011


Overview

This page focuses on very simple/general steps to bring i18n library up in your project.

Steps

  1. Choose and create a directory to put exported translated files (*.mo).
  2. In your project, initialize a {I18N_LOCALE_MANAGER} using the dir created in step 1.
  3. Write normal code that uses {I18N_LOCALE}.translation or {I18N_LOCALE}.plural_translation to get translated texts. {I18N_LOCALE} instances can be queried from {I18N_LOCALE_MANAGER}.
  4. Run po_generation_tool to extract template file (.pot) to be translated.
  5. 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.
  6. Translate .po files using external tools like poEdit for Windows and KBabel or gtranslator for KDE and Gnome.
  7. Export .mo files using the tools above. And copy them into the directory created in step 1.
  8. Run the executable, you get translated strings at run-time.


Process Diagram

I18n process diagram.png