From f887e70f000460a766a5e3754767cecf294e69cc Mon Sep 17 00:00:00 2001 From: HackerNCoder Date: Tue, 31 Jan 2023 14:23:39 +0100 Subject: [PATCH] add dict for cc to renpy names --- .po2tl.sh | 25 +++++++++++++++++++++++++ .woodpecker.yml | 18 +----------------- 2 files changed, 26 insertions(+), 17 deletions(-) create mode 100755 .po2tl.sh diff --git a/.po2tl.sh b/.po2tl.sh new file mode 100755 index 0000000..c43706e --- /dev/null +++ b/.po2tl.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +declare -A langnames=( ["es_491"]="spanish" ["pt_BR"]="brazilian_portuguese" ["ru"]="russian" ["pl"]="polish" ) + +for file in ./translations-*.po; do + file2=${file%.po} + langcc=${file2#\.\/translations\-} + if [[ -z ${langnames[$langcc]} ]]; then + lang=${langnames[$langcc]} + else + lang=$langcc + fi + + stats=$(msgfmt --statistics $${file} 2>&1) + numdone=$(echo ${stats%* translated*}) + if [ $numdone -le 5680 ] + then + continue + fi + + msgfmt "$file" -o game.mo + PATH=$(pwd)/renpy:${PATH} RENPY_DIR=$(pwd)/renpy python3 rttk-queerscriptors/mo2tl.py $(pwd)/game-source game.mo ${lang} + zip "${lang}.zip" game-source/game/tl/${lang}/* + mv "${lang}.zip" "/var/www/queer/build/${CI_REPO_NAME}/${lang}.zip" +done diff --git a/.woodpecker.yml b/.woodpecker.yml index 9f6823d..9dad284 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -7,23 +7,7 @@ pipeline: - git clone https://lab.encryptionin.space/Queerscriptors/rttk-queerscriptors.git - git clone https://lab.encryptionin.space/Queerscriptors/renpy.git - git clone -b game ${CI_REPO_REMOTE} ./game-source - - > - for file in ./translations-*.po; do - file2=$${file%.po} - langcc=$${file2#\.\/translations\-} - if [ "$langcc" = "es_419" ]; then langcc="esla"; fi - stats=$(msgfmt --statistics $${file} 2>&1) - numdone=$(echo $${stats%* translated*}) - echo $stats $numdone - if [ $numdone -le 5680 ] - then - continue - fi - msgfmt "$file" -o game.mo - PATH=$(pwd)/renpy:$${PATH} RENPY_DIR=$(pwd)/renpy python3 rttk-queerscriptors/mo2tl.py $(pwd)/game-source game.mo $${langcc} - zip "$${langcc}.zip" game-source/game/tl/$${langcc}/* - mv "$${langcc}.zip" "/var/www/queer/build/${CI_REPO_NAME}/$${langcc}.zip" - done + - bash .po2tl.sh volumes: - /var/www/queer/build/${CI_REPO_NAME}:/var/www/queer/build/${CI_REPO_NAME}