summaryrefslogtreecommitdiffhomepage
path: root/build
AgeCommit message (Collapse)Author
2020-01-25luci-base: add support for plural translations and contexts in Lua apiJo-Philipp Wich
- 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-22build: i18n-scan.pl: use xgettext to extract message stringsJo-Philipp Wich
Using xgettext has a few benefits compared to the previous perl extraction approach. The xgettext utility is able to properly distinguish commented from uncommented code and it is able handle concatenated constant expressions such as `_("Some " + "string")`. A further benefit is the ability to extract translations with disambiguation contexts and plural translation calls. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-08build: sort location annotation table in i18n sync processHannu Nyman
The scanning routine has caused unnecessary changes to the .po files if a string has been found in multiple files and those files have been found in different order than the previous time. Sort the location annotations to avoid unnecessary changes to the .po files. (sort is alphabetic, so the line numbers are also sorted alphabetically) Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi> [apply a Schwartzian transform to sort locations by path, then line number] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16build: i18n-scan.pl: support extracting translations from menu jsonJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-03treewide: move server side CBI support to luci-compatJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-05-31build: i18n-scan.pl: properly handle bracket-quoted stringsJo-Philipp Wich
Fixes: #2738 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-01-10build: add i18n-add-language.sh helperJo-Philipp Wich
This script helps to initialize a new translation language over the entire source tree. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-11-11luci-app-statistics: remove old deprecated rrdtool po filesHannu Nyman
Remove old rrdtool.po* files that have been deprecated already in 2011-2015. Also remove reference to them from i18n-sync.pl Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-11-05build: i18n-scan.pl: *.js support, location annotationsJo-Philipp Wich
Extend i18n-scan.pl to scan JavaScript files for translation strings as well and annotate produced *.po template files with source code location markers. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-10-10treewide: Fix typos in commentsyangfl
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-09-19build/mkbasepot.sh: Fix i18n after luci-mod-admin-full splitHannu Nyman
Fix i18n sync scripts by including also the three new modules luci-mod-{network,status,system} in base.pot. Note: I did not remove luci.mod-admin-full in case it will ever get some new contents. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-04-06build: add check-controller.sh, a utility to test controller filesJo-Philipp Wich
The main purpose of the script is to check if the module declaration matches and if associated cbi resources are properly referenced. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-05-08build/zoneinfo2lua.pl: logic for Etc/GMT timezonesHannu Nyman
Add logic to add Etc/GMT timezones (like GMT+5) although the zones are not included in zone.tab Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2016-03-26build/luadoc: Fix typos (found by codespell)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-02build/makedocs.sh: handle relative output directoriesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-04-20build: rework i18n-sync.sh to support new structureJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-02-04zoneinfo2lua.pl to generate shorter copyright messagesHannu Nyman
Change zoneinfo2lua.pl to generate the short copyright messages that have been there since https://github.com/openwrt/luci/commit/7a3493b1f7d75a3945279115324cf2ff4da26b7b Also change the advice on line 3 about directory, where this script should be run. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-01-28build: add modified luadoc for use with LuCI sourcesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08build: remove remainders of old build systemJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08build: adapt zoneinfo2lua.pl to new structureJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08build: adapt i18n-update.pl to new structureJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08build: adapt mkbasepot.sh to new structureJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08Rework LuCI build systemJo-Philipp Wich
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-11-01build: rewrite mkversion.sh to use git metadata (#239)Jo-Philipp Wich
The current build/mkversion.sh still expected an SVN repository layout, rewrite it to derive tags and branchnames from git metadata. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-14build: generate strictly increasing git revisions (#225)Jo-Philipp Wich
Instead of simply emitting a "git-$hash" revision, take the commit time into account to generate strictly increasing revisions to preserve opkg upgrade capabilities. The format is "git-YY.DDD.SSSSS-HHHHHHH" with the following defined fields: - YY year number (00..99) - DDD day of year (001..366) - SSSSSS second of day (00000..86399) - HHHHHHH abbreviated git commit hash An example revision is "git-14.283.50202-bb388f0". Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-13build: preserve original .po header when updating from templates to reduce ↵Jo-Philipp Wich
diff noise Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-13build: adjust mkbasepot.sh after modules/base mergeJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2013-03-25build: add mkrevision.sh helper script which properly infers the revision ↵Jo-Philipp Wich
from either svn, git-svn or git work copies
2012-12-18build: remove two obsolete scriptsJo-Philipp Wich
2012-11-20properly support git in build/i18n-init.shDaniel Golle
2012-07-01build: i18n-sync.sh: also recreate base.potJo-Philipp Wich
2012-07-01build: fixup header order in i18n-update.pl to minimize diffs to pootleJo-Philipp Wich
2012-06-27build: add i18n-sync.sh, a script to automatically sync most translationsJo-Philipp Wich
2012-04-22build: escape backslashes in i18n stringsJo-Philipp Wich
2012-04-06build/i18n-init.sh: add git supportJo-Philipp Wich
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2012-04-06build/i18n-init.sh: allow to use custom pattern for template filesJo-Philipp Wich
This allows to initialize language files for individual modules. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2012-04-03build: rework checks in i18n-scan.plJo-Philipp Wich
2012-04-02build: rework i18n-scan.pl defined checksJo-Philipp Wich
2012-04-02build/i18n-scan.pl: avoid a possible endless loopJo-Philipp Wich
Issuing './build/i18n-scan.pl libs/core/' leads to this endless loop with some perl implementations: <...> Use of uninitialized value in concatenation (.) or string at../build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. Use of uninitialized value in concatenation (.) or string at ./build/i18n-scan.pl line 69. substr outside of string at ./build/i18n-scan.pl line 69. <...> Experienced with this perl version: "This is perl, v5.8.8 built for i386-linux" Fix it by undefining the 'sub' variable if it is an empty string. Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2012-03-13build: override sys.user.getpasswd and nixio.fs.access in sdk environmentJo-Philipp Wich
2011-11-05build: i18n-scan.pl: cope with strings that contain escaped newlines, ↵Jo-Philipp Wich
spotted in luci-pbx
2011-10-27build: mkbasepot.sh: scan protocols/ as wellJo-Philipp Wich
2011-09-03build: Bail out the build if any lua compilation fails. (Patch from Fon-NG, ↵Jo-Philipp Wich
http://trac.fonosfera.org/fon-ng/changeset/1867)
2011-05-21build: add i18n-init.sh, a helper script to initalize missing *.po filesJo-Philipp Wich
2011-05-04build: uvl is dead, remove itJo-Philipp Wich
2011-03-03modules/freifunk: Set uhttpd.main.rfc1918_filter=0 via uci-defaults/freifunk ↵Manuel Munz
to allow connections from rfc1918 ip space to public ips
2011-02-16build: fix bashism in hostenv.shJo-Philipp Wich
2011-01-26build: better not use a local var, it breaks various shellsJo-Philipp Wich
2011-01-23build: set LUA_PATH when invoking LuaSrcDietJo-Philipp Wich
2011-01-23build: use maximum compression for LuaSrcDietJo-Philipp Wich