Commit Graph

165 Commits

Author SHA1 Message Date
Paul Donald
66e758dcad build: comments for Darwin when building zoneinfo.
Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-03-02 18:01:04 +01:00
Paul Donald
269df2426d build: invoke ./build/mkbasepot.sh without any parameters
e.g. to build everything

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-02-15 04:01:14 +01:00
Paul Donald
df2364f240 build: invoke ./build/mkbasepot.sh with -b
Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-02-15 01:26:38 +01:00
Paul Donald
e88294d7ac build: i18n-sync script refinements
add -P x to xargs for x number of processes.

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-02-13 05:34:29 +01:00
Paul Donald
7786a7c6c3 build/i18n-add-language: fix regexp
prevents zh, nb, bn
allows bn_BD, nb_NO, pt_BR, zh_Hans, zh_Hant

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-03 16:09:12 +00:00
Paul Donald
b98d8c526e build: update build/i18n-* tools
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>
2024-01-03 13:14:06 +00:00
Jo-Philipp Wich
b729af9ff5 build: i18n-scan.pl: process HTTPS DNS proxy provider descriptions
Ref: https://github.com/openwrt/luci/pull/6546#issue-1872235715
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-08-31 15:53:01 +02:00
Jo-Philipp Wich
c1709d15bd build: i18n-scan.pl: add support for ucode sources and templates
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>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
673f38246a treewide: separate Lua runtime resources
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>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
f2133059e1 build: add zoneinfo2ucode.pl
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>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich
d354f0b107 build: i18n-sync.sh: fix i18n-update.pl invocation
Fixes: 4d3c0f347c ("build: i18n-sync.sh: allow restricting to directory")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-22 16:32:35 +02:00
Jo-Philipp Wich
4d3c0f347c build: i18n-sync.sh: allow restricting to directory
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-18 20:12:42 +02:00
Jo-Philipp Wich
48a78f01a8 build: add script to find commits suitable for cherry picking
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-07-01 21:12:57 +02:00
Paul Spooren
c4a4e43e2e treewide: replace which with command -v
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>
2020-08-20 15:54:54 -10:00
Hannu Nyman
da7c3d9202 build/i18n-merge-master: ignore apps deleted in master
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)
2020-05-15 16:46:23 +03:00
Jo-Philipp Wich
0bc2970640 build: i18n-scan.pl: make ACL descriptions translatable
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-17 16:12:03 +02:00
Jo-Philipp Wich
556e14c743 luci-app-statistics: convert plugin definitions to JSON
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-06 12:54:07 +01:00
Jo-Philipp Wich
535d4cf8b9 build: i18n-add-language.sh: more lenient code validation
Allow language codes with underscores and capital letters.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-05 14:16:12 +01:00
Jo-Philipp Wich
cab574958c build: add script to merge master translation into branches
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-01-29 08:40:30 +01:00
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
Jo-Philipp Wich
901a0821f6 build: i18n-scan.pl: use xgettext to extract message strings
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-22 22:02:24 +01:00
Hannu Nyman
460bdfe814 build: sort location annotation table in i18n sync process
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>
2020-01-08 20:21:23 +01:00
Jo-Philipp Wich
9f9358c3e2 build: i18n-scan.pl: support extracting translations from menu json
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-12-16 18:07:17 +01:00
Jo-Philipp Wich
d5dff8f9a5 treewide: move server side CBI support to luci-compat
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-11-03 20:49:31 +01:00
Jo-Philipp Wich
4bbc033a96 build: i18n-scan.pl: properly handle bracket-quoted strings
Fixes: #2738
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-05-31 20:11:56 +02:00
Jo-Philipp Wich
e6604d7d84 build: add i18n-add-language.sh helper
This script helps to initialize a new translation language over
the entire source tree.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-01-10 10:37:52 +01:00
Hannu Nyman
36b1c60efc luci-app-statistics: remove old deprecated rrdtool po files
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-11 18:10:46 +02:00
Jo-Philipp Wich
4623a58394 build: i18n-scan.pl: *.js support, location annotations
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-11-05 11:01:45 +01:00
yangfl
401382a459 treewide: Fix typos in comments
Signed-off-by: David Yang <mmyangfl@gmail.com>
2018-10-10 15:00:07 +08:00
Hannu Nyman
90e749c63d build/mkbasepot.sh: Fix i18n after luci-mod-admin-full split
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-09-19 21:50:59 +03:00
Jo-Philipp Wich
6f47c5657f build: add check-controller.sh, a utility to test controller files
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>
2018-04-06 12:02:37 +02:00
Hannu Nyman
f8eee09f55 build/zoneinfo2lua.pl: logic for Etc/GMT timezones
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>
2017-05-08 19:29:43 +03:00
Stefan Weil
cd43e35b9d build/luadoc: Fix typos (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-03-26 10:20:46 +01:00
Jo-Philipp Wich
6c72dec7e5 build/makedocs.sh: handle relative output directories
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-09-02 09:39:24 +02:00
Jo-Philipp Wich
5fd8761583 build: rework i18n-sync.sh to support new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-04-20 10:17:23 +02:00
Hannu Nyman
cdb9de9a9d zoneinfo2lua.pl to generate shorter copyright messages
Change zoneinfo2lua.pl to generate the short copyright messages
that have been there since 7a3493b1f7

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-02-04 19:16:46 +02:00
Jo-Philipp Wich
c669c01cea build: add modified luadoc for use with LuCI sources
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28 22:28:04 +01:00
Jo-Philipp Wich
b348413fb2 build: remove remainders of old build system
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08 16:52:51 +01:00
Jo-Philipp Wich
eb25d532a8 build: adapt zoneinfo2lua.pl to new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08 16:51:47 +01:00
Jo-Philipp Wich
fe9ef86750 build: adapt i18n-update.pl to new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08 16:46:58 +01:00
Jo-Philipp Wich
85e4256a7a build: adapt mkbasepot.sh to new structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08 16:40:09 +01:00
Jo-Philipp Wich
1bb4822dca Rework LuCI build system
* 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>
2015-01-08 16:26:20 +01:00
Jo-Philipp Wich
212d7be533 build: rewrite mkversion.sh to use git metadata (#239)
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-11-01 09:53:02 +01:00
Jo-Philipp Wich
0856030c79 build: generate strictly increasing git revisions (#225)
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-10-14 13:51:37 +02:00
Jo-Philipp Wich
91ac51d693 build: preserve original .po header when updating from templates to reduce diff noise
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-13 09:40:43 +00:00
Jo-Philipp Wich
d733688ce5 build: adjust mkbasepot.sh after modules/base merge
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-06-13 09:40:40 +00:00
Jo-Philipp Wich
cf99c53a74 build: add mkrevision.sh helper script which properly infers the revision from either svn, git-svn or git work copies 2013-03-25 11:05:34 +00:00
Jo-Philipp Wich
ffec6bd451 build: remove two obsolete scripts 2012-12-18 14:20:10 +00:00
Daniel Golle
8da6c1a49f properly support git in build/i18n-init.sh 2012-11-20 11:42:35 +00:00
Jo-Philipp Wich
30a0e92e22 build: i18n-sync.sh: also recreate base.pot 2012-07-01 22:58:17 +00:00