views:

16

answers:

1

I know how to translate a natural language message into the user's language using gettext.

But now I am wondering how to obtain a list of all translatable messages in a given domain.

I have obtained a raw result with something like this:

strings /usr/share/locale/${LANG:0:2}/LC_MESSAGES/$DOMAIN.mo

but I am looking for a neater solution.

+1  A: 

The xgettext program extracts translatable strings from .po files, which are the source files for the .mo files found in /usr/share/locale. These .po files should be included in the source distribution of the package for which you want to translate messages.

If you need to work with .mo files, you can translate them back to .po with msgunfmt.

larsmans
+1 for the useful info, but requiring the source package is not the solution i'm looking for
enzotib
It's possible to do without. I updated my answer.
larsmans