Browse Source

Filter locales under 25% (#9893)

* Create update-locales.sh

* Update .drone.yml

* fix file perms +x
for-closed-social
Antoine GIRARD 4 years ago
committed by GitHub
parent
commit
99aad09bd0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions
  1. +1
    -4
      .drone.yml
  2. +18
    -0
      scripts/update-locales.sh

+ 1
- 4
.drone.yml View File

@ -317,10 +317,7 @@ steps:
pull: default
image: alpine:3.11
commands:
- 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"
- mv ./options/locale_en-US.ini ./options/locale/
- ./scripts/update-locales.sh
- name: push
pull: always

+ 18
- 0
scripts/update-locales.sh View File

@ -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/

Loading…
Cancel
Save