localization - gettext: extract dgettext() strings to domain.po files -
I have programs with multiple domains, some source files contain dgettext () calls with separate text domains.
How to remove gettext-string in multiple PO files? For example, call dgettext ('one', 'hello')
should go to a PO, and dgettext ('two', 'by')
two po . Exjector only ignores text domains and puts everything in one file.
First you need a way to separate the domain.
For example, suppose you have a domain for lib and app , then create a shortcut for dgettext ()
calls;
_app (msg) - & gt; Dgettext ("app", msg);
and for a Lib domain:
_lib (msg) - & gt; Dgettext ("lib", msg);
Add these calls to your code, such as;
show_message (_app ("Choose a directory to save your work.");); Show_message (_lib ("no space left on device."));
Remember that when you start your application, you need to call bindtextdomain ()
for both domains.
To remove them, you have to type the xgettext
keywords on all the names in your source tree, which include these markers:
xgettext --keyword = _app -d domain1 filenames ... xgettext --keyword = _lib -d domain2 filename ...
Finally, both of them. Compile po files in their binary .mo version and copy / install them to the right place.
Comments
Post a Comment