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>
This commit is contained in:
Paul Donald
2024-01-03 13:14:06 +00:00
parent c487c4f184
commit b98d8c526e
7 changed files with 90 additions and 37 deletions

View File

@@ -59,6 +59,20 @@ The actual translation files can be found at `po/[lang]/[package].po`.
In order to use the commands below you need to have the `gettext` utilities (`msgcat`, `msgfmt`, `msgmerge`) installed on your system.
On Debian/Ubuntu you can install with `sudo apt install gettext`.
### Initialize po files
When you add or update an app, simply run from your app folder:
../../build/i18n-add-language.sh
This creates the skeleton po files for all existing languages open for translation for your app.
Or from the luci repo root:
./build/i18n-add-language.sh
This creates the skeleton po files for all existing languages open for translation for all sub-folders.
### Rebuild po files
If you want to rebuild the translations after you made changes to a package this is an easy way: