Extracts gettext msgid strings from the toolbox source files. Creates/updates .po files
pofile = tbx_generate_pofile() pofile = tbx_generate_pofile(tbx_path) pofile = tbx_generate_pofile(tbx_name) // obsolete pofile = tbx_generate_pofile(tbx_name, tbx_path) // obsolete
path of the toolbox, use to locate files to compile.
name of the toolbox, use to name localization files and domain.
![]() | tbx_name is now retrieved as the basename of the file
tbx_path/etc/*.start . This file must exist, even if it is empty. |
return the generated po file path.
tbx_generate_pofile(…)
scans all toolbox source files for
every call to gettext(domain,msgid)
, _(domain,msgid)
,
(or _d(domain,msgid)
in XML files like the preferences file, if any).
Then, ~ being the toolbox root directory:
~/locales/en_US.po
reference file does not exist yet,
it is created.
~/locales/*.po
files are updated with
gettext msgid strings newly detected in all source files of the toolbox.
Note: presently, obsolete msgids (no longer present in any source file) are kept.
![]() | Translators are expected to edit #: ~\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. |
Version | Description |
5.5.0 | Function tbx_generate_pofile added. |
6.0.0 | tbx_name declared obsolete. It is no longer required. |
6.0.1 |
|
2023.0.0 | Existing .po files are now automatically updated for every newly detected msgid. |