From a044b6d460165e3ba667f1af92da28e7a1ec47ed Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 20 Jul 2018 01:37:27 +0200 Subject: [PATCH] Update crowdin instructions for linux --- tools/crowdin-cli/README.md | 20 +++++++++++++------- tools/crowdin-cli/archi_download.sh | 20 ++++++++++++++++++++ tools/crowdin-cli/archi_sync.sh | 28 ++++++++++++++++++++++++++++ tools/crowdin-cli/archi_upload.sh | 14 ++++++++++++++ tools/crowdin-cli/crowdin.sh | 0 5 files changed, 75 insertions(+), 7 deletions(-) create mode 100755 tools/crowdin-cli/archi_download.sh create mode 100755 tools/crowdin-cli/archi_sync.sh create mode 100755 tools/crowdin-cli/archi_upload.sh mode change 100644 => 100755 tools/crowdin-cli/crowdin.sh diff --git a/tools/crowdin-cli/README.md b/tools/crowdin-cli/README.md index 75d35df84..9728686ce 100644 --- a/tools/crowdin-cli/README.md +++ b/tools/crowdin-cli/README.md @@ -17,23 +17,29 @@ This tool is being used by ASF developers for synchronization of strings/transla - Make sure that your `crowdin_identity.yml` file exists - this is the file with login credentials that is not being committed to GitHub. If it doesn't exist yet (e.g. because you've just cloned the repo), create it from `crowdin_identity_example.yml` and fill `api_key` that can be found **[here](https://crowdin.com/project/archisteamfarm/settings#api)**. -- Ensure that `crowdin` command is recognized by your OS. - --- +## Installation + ### Windows -- Install **[Java JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)**. +- Install **[Java JRE](http://www.oracle.com/technetwork/java/javase/downloads/index.html)** (or entire JDK). - **[Set JAVA_HOME properly](https://confluence.atlassian.com/doc/setting-the-java_home-variable-in-windows-8895.html)**. - Launch `setup_crowdin.bat` as administrator. -- Open new `cmd` prompt and verify that `crowdin help` indeed works. + +### Linux +- Install **[OpenJDK JRE](http://openjdk.java.net/install)** (or entire JDK). +- **[Set JAVA_HOME properly](https://stackoverflow.com/questions/24641536/how-to-set-java-home-in-linux-for-all-users)**. +- Launch `crowdin.sh` as root. + +Afterwards you should verify in shell that `crowdin help` command is recognized. --- ## Usage -- `archi_upload.ps1` for pushing strings to Crowdin. +- `archi_upload` for pushing strings to Crowdin. -- `archi_download.ps1` for downloading translations from Crowdin (typically last commit before release). +- `archi_download` for downloading translations from Crowdin. -- `archi_sync.ps1` for upload + download (tree sync). +- `archi_sync` for upload + download. diff --git a/tools/crowdin-cli/archi_download.sh b/tools/crowdin-cli/archi_download.sh new file mode 100755 index 000000000..0009ab5b8 --- /dev/null +++ b/tools/crowdin-cli/archi_download.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -eu + +cd "$(dirname "$(readlink -f "$0")")" +cd ../.. + +crowdin -b master --identity tools/crowdin-cli/crowdin_identity.yml download +git reset + +cd wiki +git pull +git add -A "locale/*.md" +git commit -m "Translations update" +cd .. + +git add -A "ArchiSteamFarm/Localization/*.resx" "ArchiSteamFarm/www/locale/*.json" "WebConfigGenerator/src/locale/*.json" "wiki" +git commit -m "Translations update" + +git push --recurse-submodules=on-demand +read -p "Press enter to continue..." diff --git a/tools/crowdin-cli/archi_sync.sh b/tools/crowdin-cli/archi_sync.sh new file mode 100755 index 000000000..69ec2d2c3 --- /dev/null +++ b/tools/crowdin-cli/archi_sync.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -eu + +cd "$(dirname "$(readlink -f "$0")")" +cd ../.. + +cd wiki +git reset --hard +git clean -fd +git pull +cd .. + +crowdin -b master --identity tools/crowdin-cli/crowdin_identity.yml upload sources + +crowdin -b master --identity tools/crowdin-cli/crowdin_identity.yml download +git reset + +cd wiki +git pull +git add -A "locale/*.md" +git commit -m "Translations update" +cd .. + +git add -A "ArchiSteamFarm/Localization/*.resx" "ArchiSteamFarm/www/locale/*.json" "WebConfigGenerator/src/locale/*.json" "wiki" +git commit -m "Translations update" + +git push --recurse-submodules=on-demand +read -p "Press enter to continue..." diff --git a/tools/crowdin-cli/archi_upload.sh b/tools/crowdin-cli/archi_upload.sh new file mode 100755 index 000000000..84c60a0fd --- /dev/null +++ b/tools/crowdin-cli/archi_upload.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -eu + +cd "$(dirname "$(readlink -f "$0")")" +cd ../.. + +cd wiki +git reset --hard +git clean -fd +git pull +cd .. + +crowdin -b master --identity tools/crowdin-cli/crowdin_identity.yml upload sources +read -p "Press enter to continue..." diff --git a/tools/crowdin-cli/crowdin.sh b/tools/crowdin-cli/crowdin.sh old mode 100644 new mode 100755