[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant-backoffice] branch master updated: fix i18n extractor (#
From: |
gnunet |
Subject: |
[taler-merchant-backoffice] branch master updated: fix i18n extractor (#7140) |
Date: |
Mon, 03 Jan 2022 09:26:20 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository merchant-backoffice.
The following commit(s) were added to refs/heads/master by this push:
new d786453 fix i18n extractor (#7140)
d786453 is described below
commit d786453c6b4e6ce67f41ff3b25d4e51059333491
Author: ms <ms@taler.net>
AuthorDate: Mon Jan 3 09:26:10 2022 +0100
fix i18n extractor (#7140)
---
build-translations.sh | 50 +++++++++++++++++++++++++++-------------------
packages/bank/package.json | 2 ++
2 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/build-translations.sh b/build-translations.sh
index 0ce7d57..fc72b99 100755
--- a/build-translations.sh
+++ b/build-translations.sh
@@ -1,25 +1,35 @@
#!/bin/bash
-cd packages/frontend;
-PONAME=taler-merchant-backoffice
-POGEN=node_modules/@gnu-taler/pogen/bin/pogen.js
+set -eu
-find src \( -name '*.ts' -or -name '*.tsx' \) ! -name '*.d.ts' \
- | xargs node $POGEN \
- | msguniq \
- | msgmerge src/i18n/poheader - \
- > src/i18n/$PONAME.pot
+function build {
+ POTGEN=node_modules/@gnu-taler/pogen/bin/pogen
+ PACKAGE_NAME=$1
-# merge existing translations
-for pofile in src/i18n/*.po; do
- echo merging $pofile;
- msgmerge -o $pofile $pofile src/i18n/$PONAME.pot;
-done;
-
-# generate .ts file containing all translations
-cat src/i18n/strings-prelude > src/i18n/strings.ts
-for pofile in src/i18n/*.po; do \
- echo appending $pofile; \
- ./contrib/po2ts $pofile >> src/i18n/strings.ts; \
-done;
+ find \( -type d -name '*.ts' -or -name '*.tsx' \) ! -name '*.d.ts' \
+ | xargs node $POTGEN \
+ | msguniq \
+ | msgmerge src/i18n/poheader - \
+ > src/i18n/$PACKAGE_NAME.pot
+
+ # merge existing translations: fails when NO .po-files were found.
+ for pofile in $(ls src/i18n/*.po 2> /dev/null || true); do
+ echo merging $pofile;
+ msgmerge -o $pofile $pofile src/i18n/$PACKAGE_NAME.pot;
+ done;
+
+ # generate .ts file containing all translations
+ cat src/i18n/strings-prelude > src/i18n/strings.ts
+ for pofile in $(ls src/i18n/*.po 2> /dev/null || true); do \
+ echo appending $pofile; \
+ ./contrib/po2ts $pofile >> src/i18n/strings.ts; \
+ done;
+}
+for package in $(ls packages); do
+ echo "Building $package.."
+ cd packages/$package
+ build package
+ echo "DONE"
+ cd -
+done
diff --git a/packages/bank/package.json b/packages/bank/package.json
index 3db98b1..8218878 100644
--- a/packages/bank/package.json
+++ b/packages/bank/package.json
@@ -53,6 +53,7 @@
"@typescript-eslint/parser": "^5.3.0",
"jest-fetch-mock": "^3.0.3",
"bulma": "^0.9.3",
+ "@gnu-taler/pogen": "^0.0.5",
"bulma-checkbox": "^1.1.1",
"bulma-radio": "^1.1.1",
"enzyme": "^3.11.0",
@@ -61,6 +62,7 @@
"eslint-config-preact": "^1.2.0",
"jest": "^27.3.1",
"jest-preset-preact": "^4.0.5",
+ "po2json": "^0.4.5",
"jssha": "^3.2.0",
"preact-cli": "3.0.5",
"sass": "1.32.13",
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant-backoffice] branch master updated: fix i18n extractor (#7140),
gnunet <=