tbx_build_localization
Builds or updates localization .po and .mo files of a toolbox
Syntax
tbx_build_localization() tbx_build_localization(tbx_path)
Arguments
- tbx_path
path of the toolbox, use to locate files to compile.
Description
tbx_build_localization(…)
calls tbx_generate_pofile(…)
to create the ~/locales/en_US.po
reference file, or to updated
all existing ~/locales/*.po
files.
*.po files -- one for each language -- are text editable files where reference english
messages used when calling gettext(domain, "The message")
are listed.
Below each reference message (msgid), the translated version is provided. As an example,
here is a sample of a fr_FR.po file (with extra comments):
#: ~\macros\scilab_add.sci:13 << file:line_number places where gettext() is called for the msgid. #: ~\macros\scilab_error.sci:22 << The same message is used in another file. etc. msgid "New message #2.\n" << gettext() argument = reference message (english) msgstr "Nouveau message n° 2.\n" << translated message (entered by a translator). #: ~\macros\scilab_add.sci:16 msgid "New message #3.\n" msgstr "" << Missing translation, to complete.
For more details about how .po files are built, please refer to the tbx_generate_pofile page.
Then, for each language * defined for the toolbox,
~/locales/*/LC_MESSAGES/*.mo
files are built from translated messages.
*.mo files are binary files used by gettext(msgid) at call time to quickly get the
translation.
Examples
tbx_make SCI/contrib/toolbox_skeleton localization
is equivalent to
tbx_build_localization SCI/contrib/toolbox_skeleton
--> tbx_build_localization SCI/contrib/toolbox_skeleton WARNING: tbx_build_localization (toolbox_skeleton\locales\): WARNING: - The msgid have been updated in *.po files. WARNING: - fr_FR.po : 0 untranslated messages. Generating localization -- Building for "en_US" -- -- Building for "fr_FR" --
See also
- tbx_make . localization — Builds a toolbox having a standard structure (EXPERIMENTAL)
- tbx_generate_pofile — Extracts gettext msgid strings from the toolbox source files. Creates/updates .po files
- addlocalizationdomain — add a new domain in localization mechanism.
- gettext — индексирует или/и переводит некоторые индексированные сообщения на английском языке
History
Версия | Описание |
5.5.0 | Function tbx_build_localization added. |
6.0.0 | tbx_name is no longer required. |
2023.0.0 | Existing .po files are now automatically updated for every newly detected msgid. tbx_name input argument removed. |
Report an issue | ||
<< tbx_build_loader | Sections builders | tbx_build_src >> |