forked from sugarchain-project/esplora
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
l10n: Add "npm run fetch-transfiex" script to update all translation …
…files
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The `.json` files in this directory are auto-generated from the `.po` files | ||
using the `build-json.sh` utility script. Please do not edit `.json` files | ||
directly. | ||
|
||
To contribute translations, please visit https://www.transifex.com/blockstream/esplora |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
TRANSIFEX_PROJECT=esplora | ||
TRANSIFEX_RESOURCE=esplora | ||
|
||
for file in lang/*.po; do | ||
lang=`basename $file` | ||
lang=${lang%.*} | ||
lang=${lang%-*} | ||
|
||
# These are identified differently by transifex | ||
[ "$lang" == "me" ] && lang=sr_ME | ||
[ "$lang" == "jp" ] && lang=ja | ||
|
||
echo "Downloading $lang from transifex to $file" | ||
curl -s -L -u api:$TRANSIFEX_KEY https://www.transifex.com/api/2/project/$TRANSIFEX_PROJECT/resource/$TRANSIFEX_RESOURCE/translation/$lang?file=po > $file | ||
|
||
echo "Generating json from $file" | ||
./lang/po2json.js < $file > ${file%.*}.json | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters