2011-10-04 44 views
1

我使用它來提取需要翻譯的所有字符串文字:了xgettext提取錯誤的文字

xgettext -o [email protected] -k"Localizer.get" $^ --from-code=utf-8 

這些應該被提取:

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

這些不是:

SettingsWrapper.getString("date_format") 

但兩者結束在我的.pot文件中:

msgid "date_format" 
msgstr "" 

有沒有什麼方法可以使這個直線?

回答

3

xgettext manual,getString是Java的默認keyword specification。您需要禁用默認關鍵字,並明確包含您希望啓用的所有禁用的關鍵字規範。嘗試將-k"Localizer.get"更改爲-k -k"Localizer.get"

+0

太好了,修好了! –