You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koreader/frontend
Frans de Jonge 0067c8f29e
[i18n, feat] Add basic context (msgctxt) support (#5234)
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
```
5 years ago
..
apps [fix] Prevent double run genFooterText (#5233) 5 years ago
device [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 5 years ago
document [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 5 years ago
ui [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 5 years ago
cache.lua rename runtimectl to document/canvascontext 5 years ago
cacheitem.lua cleanup: expand tab to 4 spaces 10 years ago
configurable.lua decouple UI definitions from document modules 5 years ago
dbg.lua use android log categories 5 years ago
depgraph.lua Gesture manager (initial) (#4240) 6 years ago
device.lua [feat] Add support for BQ/Fnac devices (#4294) 6 years ago
docsettings.lua Fix crash and History with books in read-only directories (#4138) 6 years ago
dump.lua Docs: dump & random 7 years ago
fontlist.lua [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 5 years ago
gettext.lua [i18n, feat] Add basic context (msgctxt) support (#5234) 5 years ago
httpclient.lua build: enforce luacheck in travis build 8 years ago
logger.lua use android log categories 5 years ago
luadata.lua Add LuaData and Dictionary Lookup History (#3161) 7 years ago
luasettings.lua Various blitting related cleanups (#4789) 5 years ago
luxl.lua treate quoted slash as plain text in attribute value 10 years ago
optmath.lua Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847) 5 years ago
pluginloader.lua Add vertical edge gesture (#5156) 5 years ago
pluginshare.lua Move PluginShare.backgroundJobs into PluginShare module (#3128) 7 years ago
random.lua Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847) 5 years ago
readhistory.lua History: show files sizes, as File browser does 5 years ago
up_reg.list adapt widgets to new refresh/repaint API 10 years ago
util.lua More footer options, default to use icons as prefixes (#5203) 5 years ago
version.lua [doc, fix] Some documentation issues (#5066) 5 years ago