luci/build
Jo-Philipp Wich 9939fc5a26 luci-base: add support for plural translations and contexts in Lua api
- Introduce a new luci.template.parser.ntranslate() function which
   takes a count, a singular and a plural translation string as well
   as an optional context argument and returns the appropriate,
   language specific plural translation.

 - Introduce an optional translation context argument in the existing
   luci.template.parser.translate() function

 - Support translation contexts in LuCI template directives.
   Translation messages are split on the first unescaped pipe
   character and the reamining string after the pipe is treated
   as context.

Examples:

 - `string.format(p.ntranslate(n, "1 apple", "%d apples"), n)` will
   return an appropriate plural translation for the given amount.

 - `translate("Load", "The system load")` will return an appropiate
   translation for `Load`, using `The system load` as disambiguation
   context (a `msgctxt` directive in *.po files).

 - Likewise `<%:Load|The system load%>` will translate the word
   `Load` while using the remainder of the string as context.

 - To use pipes in translations strings literally, they must be
   escaped: `<%:Use the "\|" character%>` will translate the literal
   string `Use the "|" character`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-25 23:21:35 +01:00
..
luadoc treewide: Fix typos in comments 2018-10-10 15:00:07 +08:00
check-controllers.sh treewide: Fix typos in comments 2018-10-10 15:00:07 +08:00
i18n-add-language.sh build: add i18n-add-language.sh helper 2019-01-10 10:37:52 +01:00
i18n-init.sh properly support git in build/i18n-init.sh 2012-11-20 11:42:35 +00:00
i18n-po2lua.pl build: readd both po2lua and lua2po helper scripts... 2011-01-18 20:51:24 +00:00
i18n-scan.pl luci-base: add support for plural translations and contexts in Lua api 2020-01-25 23:21:35 +01:00
i18n-sync.sh luci-app-statistics: remove old deprecated rrdtool po files 2018-11-11 18:10:46 +02:00
i18n-update.pl build: adapt i18n-update.pl to new structure 2015-01-08 16:46:58 +01:00
makedocs.sh build/makedocs.sh: handle relative output directories 2015-09-02 09:39:24 +02:00
mkbasepot.sh treewide: move server side CBI support to luci-compat 2019-11-03 20:49:31 +01:00
mkrevision.sh build: generate strictly increasing git revisions (#225) 2014-10-14 13:51:37 +02:00
zoneinfo2lua.pl build/zoneinfo2lua.pl: logic for Etc/GMT timezones 2017-05-08 19:29:43 +03:00