I need some help with gettext
Moderator: Forum Moderators
I need some help with gettext
Since somebody here managed to split the game into multiple text domains, maybe you can help me with a problem that I have already googled to death with no avail.
I know this is not a coding support forum, but I don't know where else to ask anymore. Any hints before I completely tear my hair out will be appreciated
Problem summary:
I have recently gotten involved with a project where the po file has grown to a size that is daunting for new localizers. So, I want to chop it down into smaller units. I read up on the gettext documentation and happily marked all my strings, only to find out there are no tools to generate the pot files if you wish to use more than one textdomain. I will keep all the xml and desktop file stuff in my default textdomain, so I can continue to use intltool for those. I need a solution for C and Python.
What I've done so far:
So, after a couple of days' searching, I found this solution: http://stackoverflow.com/questions/1587 ... n-po-files
In Python, my code looks like this:
And then I call
I know this is not a coding support forum, but I don't know where else to ask anymore. Any hints before I completely tear my hair out will be appreciated
Problem summary:
- generate separate pot-files for more than one textdomain and place them in subdirectories below po (e.g.
po/gcompris-gui
) - convince
make install
to copy the mo files toLC_MESSAGES
in a way that's distribution safe
I have recently gotten involved with a project where the po file has grown to a size that is daunting for new localizers. So, I want to chop it down into smaller units. I read up on the gettext documentation and happily marked all my strings, only to find out there are no tools to generate the pot files if you wish to use more than one textdomain. I will keep all the xml and desktop file stuff in my default textdomain, so I can continue to use intltool for those. I need a solution for C and Python.
What I've done so far:
So, after a couple of days' searching, I found this solution: http://stackoverflow.com/questions/1587 ... n-po-files
In Python, my code looks like this:
Code: Select all
def _gui(text):
gettext.dgettext(gcompris.GETTEXT_GUI,text)
test1 = _gui("Test1")
test2 = _("Test2")
Code: Select all
xgettext --keyword=_gui -d gcompris-gui -o gcompris-gui.pot -p ../po/gcompris-gui --package-name=GCompris-GUI -D hangman-activity/hangman.py
intltool-update
now ignores test1 as it should, butxgettext
picks up both strings in spite of the keyword specification.- I have no problem generating the po-files for each language and compiling the mo-files, but then I'm completely stumped as to how to add them to the
make
stuff so that they will get installed toLC_MESSAGES