2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
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
```
2019-08-21 19:40:15 +02:00
..
apps [fix] Prevent double run genFooterText (#5233) 2019-08-21 15:00:09 +02:00
device [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 2019-08-20 18:38:02 +02:00
document [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 2019-08-20 18:38:02 +02:00
ui [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 2019-08-20 18:38:02 +02:00
cache.lua rename runtimectl to document/canvascontext 2019-03-03 13:10:45 +01:00
cacheitem.lua cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
configurable.lua decouple UI definitions from document modules 2019-03-03 13:10:45 +01:00
dbg.lua use android log categories 2019-01-03 08:56:29 +01:00
depgraph.lua Gesture manager (initial) (#4240) 2018-09-29 23:15:57 +02:00
device.lua [feat] Add support for BQ/Fnac devices (#4294) 2018-10-31 23:48:36 +01:00
docsettings.lua Fix crash and History with books in read-only directories (#4138) 2018-08-06 21:30:05 +02:00
dump.lua Docs: dump & random 2017-04-14 11:40:35 -07:00
fontlist.lua [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220) 2019-08-20 18:38:02 +02:00
gettext.lua [i18n, feat] Add basic context (msgctxt) support (#5234) 2019-08-21 19:40:15 +02:00
httpclient.lua build: enforce luacheck in travis build 2016-02-09 23:01:52 -08:00
logger.lua use android log categories 2019-01-03 08:56:29 +01:00
luadata.lua Add LuaData and Dictionary Lookup History (#3161) 2017-10-07 22:13:46 +02:00
luasettings.lua Various blitting related cleanups (#4789) 2019-03-14 20:58:45 +01:00
luxl.lua treate quoted slash as plain text in attribute value 2014-09-10 13:27:14 +08:00
optmath.lua Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847) 2019-03-27 22:50:44 +01:00
pluginloader.lua Add vertical edge gesture (#5156) 2019-08-01 19:08:09 +02:00
pluginshare.lua Move PluginShare.backgroundJobs into PluginShare module (#3128) 2017-08-24 09:10:57 +02:00
random.lua Faster blitting @ BB8/BBRGB32 when no processing is needed (#4847) 2019-03-27 22:50:44 +01:00
readhistory.lua History: show files sizes, as File browser does 2019-01-01 20:19:09 +01:00
up_reg.list adapt widgets to new refresh/repaint API 2014-11-30 00:17:50 +00:00
util.lua More footer options, default to use icons as prefixes (#5203) 2019-08-16 23:22:58 +02:00
version.lua [doc, fix] Some documentation issues (#5066) 2019-06-09 15:50:22 +02:00