Posted on

Translating JavaScript WebApp with GetText

GNU GetText is very powerful tool for translation of applications. Entire Linux world is using it. The tool-set includes original text changes tracking, automatic translations and more. Several user interfaces are available to make translation work faster. Programmers have very solid and understandable way to write original texts into code like this:

{
  the_need: _("I want an red apple")
}

The tools will collect this into translation intermediate file looking for the special function _() from the code with translatable strings. The intermediate file is text file and looks like this:

#: ../source/app_account.js:15
msgid "I want an red apple"
msgstr ""

where msgid is the original text and msgstr is translated string. GetText for C/C++ and other compiled languages is going to order the msgid text in ascending order so that the translation can be found using binary search algorithm and is taking least possible time.

Continue reading Translating JavaScript WebApp with GetText