mirror of https://github.com/go-gitea/gitea.git
Filter locales under 25% (#9893)
* Create update-locales.sh * Update .drone.yml * fix file perms +x
This commit is contained in:
parent
8cb9b2f016
commit
99aad09bd0
|
@ -317,10 +317,7 @@ steps:
|
||||||
pull: default
|
pull: default
|
||||||
image: alpine:3.11
|
image: alpine:3.11
|
||||||
commands:
|
commands:
|
||||||
- mv ./options/locale/locale_en-US.ini ./options/
|
- ./scripts/update-locales.sh
|
||||||
- "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/
|
|
||||||
|
|
||||||
- name: push
|
- name: push
|
||||||
pull: always
|
pull: always
|
||||||
|
|
|
@ -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…
Reference in New Issue