-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Some notes for extracting strings from source code files with xgettext.
I have found the following commandline options to work well for me:
xgettext -a -o - --no-wrap --no-location --omit-header -
This reads the data from standard input, and outputs results on standard output. The standard gettext header is not included (which makes parsing a little bit easier) and file name data is also not included (the "location"), as I am assuming I already know which file I am reading plus I am not interested in the location(s) of the strings in the file (but maybe this is something you want). This also makes parsing things a little bit easier. The --no-wrap parameter is for putting results on a single line, which also makes processing results easier.
Some options that are worth looking at: -L as xgettext tends to only look at file extensions.