mirror of
https://github.com/koreader/koreader
synced 2024-10-31 21:20:20 +00:00
0067c8f29e
References https://github.com/koreader/koreader/issues/5232 Given an entry in the PO file like the following: ``` msgctxt "systemstat" msgid " Total" msgstr "Totaal" ``` It can be addressed using: ```lua local _ = require("gettext") local C_ = _.pgettext C_("systemstat", " Total") ``` This allows to distinguish between separate instances of the same string, for example "Pages" meaning "Number of pages" and "Pages" meaning "Display of pages". Extraction of this code pattern is not yet implemented by nightswatcher. xgettext didn't yet support Lua back in 2013 when all this was first added to the program, but now it does. Therefore it might make the most sense to replace the current Python extraction script with xgettext itself. By default it only understands gettext.pgettext(), but that can be addressed by passing some extra command line arguments, for example: ``` xgettext -l lua -c --keyword=C_:1c,2 *.lua ``` |
||
---|---|---|
.. | ||
apps | ||
device | ||
document | ||
ui | ||
cache.lua | ||
cacheitem.lua | ||
configurable.lua | ||
dbg.lua | ||
depgraph.lua | ||
device.lua | ||
docsettings.lua | ||
dump.lua | ||
fontlist.lua | ||
gettext.lua | ||
httpclient.lua | ||
logger.lua | ||
luadata.lua | ||
luasettings.lua | ||
luxl.lua | ||
optmath.lua | ||
pluginloader.lua | ||
pluginshare.lua | ||
random.lua | ||
readhistory.lua | ||
up_reg.list | ||
util.lua | ||
version.lua |