Question

I use this to extract all string literals that need translation:

xgettext -o $@ -k"Localizer.get" $^ --from-code=utf-8

These should be extracted:

Localizer.get("Could not find the config file. (This should *not* happen!)")

These not:

SettingsWrapper.getString("date_format")

But both end up in my .pot file:

msgid "date_format"
msgstr ""

Is there some way to get this straight?

Was it helpful?

Solution

From the xgettext manual, getString is a default keyword specification for Java. You will need to disable default keywords and explicitly include any desired keyword specifications that were disabled which you want to enable. Try changing -k"Localizer.get" to -k -k"Localizer.get".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top