summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2020-01-21 17:26:17 +0100
committerGitHub <noreply@github.com>2020-01-21 17:26:17 +0100
commit99aad09bd041cb3e518f2ade4238beab84243366 (patch)
tree329f61e1dd81cfafb6be9f297ea390a990d12680 /scripts
parent8cb9b2f016f0a5c1aa3e907d4d6640c3c9ba5d57 (diff)
downloadgitea-99aad09bd041cb3e518f2ade4238beab84243366.tar.gz
gitea-99aad09bd041cb3e518f2ade4238beab84243366.zip
Filter locales under 25% (#9893)
* Create update-locales.sh * Update .drone.yml * fix file perms +x
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-locales.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/update-locales.sh b/scripts/update-locales.sh
new file mode 100755
index 0000000000..214474da76
--- /dev/null
+++ b/scripts/update-locales.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+mv ./options/locale/locale_en-US.ini ./options/
+sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini
+sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini
+
+# Remove translation under 25% of en_us
+baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
+baselines=$((baselines / 4))
+for filename in ./options/locale/*.ini; do
+ lines=`wc -l "$filename" | cut -d" " -f1`
+ if [ $lines -lt $baselines ]; then
+ echo "Removing $filename: $lines/$baselines"
+ rm "$filename"
+ fi
+done
+
+mv ./options/locale_en-US.ini ./options/locale/