mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-03-07 15:21:06 +02:00
Add script to update translation files from Crowdin
This commit is contained in:
parent
92d4073b2a
commit
5b6dbe57b1
27
scripts/update_language_files.sh
Executable file
27
scripts/update_language_files.sh
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Since I couldn't get crowdin-cli to work yet, I'm doing things a bit more
|
||||||
|
# manually for now. The process is as follows:
|
||||||
|
#
|
||||||
|
# 1. Download the translations from Crowdin as a zip file
|
||||||
|
# 2. Unzip the file
|
||||||
|
# 3. Run this script with the path to the unzipped directory as an argument
|
||||||
|
#
|
||||||
|
# Requires jq (1.7 or later): https://github.com/jqlang/jq
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 <download_dir>"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
download_dir="$1"
|
||||||
|
|
||||||
|
for d in "$download_dir"/*
|
||||||
|
do
|
||||||
|
# We need to remove empty strings from the JSON files; those are the ones
|
||||||
|
# that haven't been translated yet. Crowdin has an option to skip these when
|
||||||
|
# exporting, but unfortunately it doesn't work for json files.
|
||||||
|
jq 'del(..|select(. == ""))' < "$d/en.json" > pkg/i18n/translations/$(basename "$d").json
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user