From ddbe6524c3a1958d93362a2f25b6b4c3d004f0a2 Mon Sep 17 00:00:00 2001 From: ix5 Date: Mon, 21 Mar 2022 20:59:58 +0100 Subject: [PATCH] bin: Remove transifex helpers Isso's use of Transifex has languished for quite a while now and there's seemingly no one to review strings or lead a translation for a specific language at the moment. All recent translation-related contributions have come via PRs. --- bin/tx-pull | 13 ------------- bin/tx-push | 34 ---------------------------------- 2 files changed, 47 deletions(-) delete mode 100755 bin/tx-pull delete mode 100755 bin/tx-push diff --git a/bin/tx-pull b/bin/tx-pull deleted file mode 100755 index 1f9d88490..000000000 --- a/bin/tx-pull +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env fish - -set -g TRANSIFEX ".tx/js/" -set -g JS "isso/js/app/i18n/%s.js" - -# fetch latest translations to .tx// -tx pull -a - -for lang in (ls $TRANSIFEX) - printf "define(" > (printf $JS $lang) - cat .tx/js/$lang >> (printf $JS $lang) - printf ");\n" >> (printf $JS $lang) -end diff --git a/bin/tx-push b/bin/tx-push deleted file mode 100755 index 7ad05b533..000000000 --- a/bin/tx-push +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env fish - -set TRANSIFEX "https://www.transifex.com/api/2" - -if [ (count $argv) -ne 1 ] - echo "tx-push FILE" - exit 2 -end - -if [ ! -f ~/.transifexrc ] - echo "no ~/.transifexrc found" - exit 1 -end - -set user (cat ~/.transifexrc | grep -E "^username" | awk -F " ?= ?" '{ print $2 }') -set pass (cat ~/.transifexrc | grep -E "^password" | awk -F " ?= ?" '{ print $2 }') - -set lang (echo $argv | cut -d / -f 5 | cut -d . -f 1) -set trans (mktemp -t tx.XXX) - -if [ $lang = "en" ] - set url "$TRANSIFEX/project/isso/resource/js/content/" -else - set url "$TRANSIFEX/project/isso/resource/js/translation/$lang/" -end - -printf '{"content":' > $trans -cat $argv \ - | sed "s,^define(,,g;\$ s,);,,g" \ - | python -c 'import json,sys; print json.dumps(sys.stdin.read())' \ - >> $trans -printf '}' >> $trans - -curl -L -u $user:$pass -XPUT $url -H "Content-Type: application/json" -d @$trans