Age | Commit message (Collapse) | Author |
|
modify i18n-add-language.sh so it can:
- be run from any path
- bootstrap any (or all) po folder(s) with existing language(s)
- (partially) update luci.mk with new languages
deprecate build/i18n-init.sh
Signed-off-by: Paul Donald <newtwen@gmail.com>
|
|
Ref: https://github.com/openwrt/luci/pull/6546#issue-1872235715
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Recognize ucode source files and ucode templates and add the necessary logic
to preprocess ucode templates into valid JavaScript sources.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Move classes required for Lua runtime support into a new `luci-lua-runtime`
package. Also replace the `luci.http` and `luci.util` classes in
`luci-lib-base` with stubbed versions interacting with the ucode based
runtime environment.
Finally merge `luci-base-ucode` into the remainders of `luci-base`.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Add a zoneinfo2ucode.pl script which is the ucode equivalent to
zoneinfo2lua.pl. It will generate a ucode module exporting a dictionary
of known timezone names and their corresponding TZ strings.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fixes: 4d3c0f347c ("build: i18n-sync.sh: allow restricting to directory")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fix shellcheck SC2230
> which is non-standard. Use builtin 'command -v' instead.
Once applied to everything concerning OpenWrt we can disable the busybox
feature `which` and save 3.8kB.
Signed-off-by: Paul Spooren <mail@aparcar.org>
|
|
Refine the code to ignore apps that have been deleted from master
but still exist in release branches. E.g. luci-app-samba
Previously the unhandled git error from non-existing master
mangled the .po files in the release branch: the 18n header was
removed and all non-ASCII chars were deleted from translation.
Fix this by processing only those files where 'git show' succeeds.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit e4baee8d25 in openwrt-19.07)
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Allow language codes with underscores and capital letters.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
- 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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
Fixes: #2738
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
This script helps to initialize a new translation language over
the entire source tree.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
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>
|
|
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>
|
|
Signed-off-by: David Yang <mmyangfl@gmail.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Stefan Weil <sw@weilnetz.de>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
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>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
* 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>
|
|
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>
|
|
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>
|
|
diff noise
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
|
|
from either svn, git-svn or git work copies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
This allows to initialize language files for individual modules.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|