On 1/22/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 1/22/07, Dan McGee <dpmcgee@gmail.com> wrote:
I found it yesterday and the manual still confuses me. :) Is there no make target to update the po files? I figured automake would build one in, but I guess I'm wrong; I couldn't find it yesterday.
Yeah, it took me a tad to get my head around the concepts too - perhaps it has to do with being a native en_US speaker and not having to deal with huge amounts of translations.
Basically, xgettext finds the strings it needs (I don't know precisely if it scans for _("foo") or not, or just grabs all strings - that's probably in the docs somewhere), and spits them out to a file (pacman.pot for the src/pacman/po dir). This file is then copied to some LANG.po and translations are added.
I think if you add the option --keyword=_ to xgettext, it does what we expect. Also, it seems like there is a file listing in POTFILES.in of some sort, although just doing a *.c selector should work... msgmerge allows you to update existing po files and keep the original translations if they still apply.
The _("foo") macro which is part of util.h (in src/pacman) calls gettext with the the translation "domain", which appears to be "pacman": pacman.c: bindtextdomain("pacman", "/usr/share/locale"); This just does the lookup based on the user's locale.
So. Anytime you add a new string, change a string, or do something of that nature, it should: a) be surrounded by the _() macro, so it's translatable b) need a translation, or the translation fixed.
Now, for the record, I'm not really sure about the significance of po4a. All I know is it's supposed to "aid in maintaining translations" - it adds some sort of convenience layer on top, but as I said, I don't know any other language passably enough to translate, so have no experience with this side of things.
I think po4a is mainly for docs- e.g. the man pages.