Skip to content

Commit 99aad09

Browse files
authored
Filter locales under 25% (#9893)
* Create update-locales.sh * Update .drone.yml * fix file perms +x
1 parent 8cb9b2f commit 99aad09

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.drone.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,7 @@ steps:
317317
pull: default
318318
image: alpine:3.11
319319
commands:
320-
- mv ./options/locale/locale_en-US.ini ./options/
321-
- "sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini"
322-
- "sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini"
323-
- mv ./options/locale_en-US.ini ./options/locale/
320+
- ./scripts/update-locales.sh
324321

325322
- name: push
326323
pull: always

scripts/update-locales.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
mv ./options/locale/locale_en-US.ini ./options/
4+
sed -i -e 's/=\"/=/g' -e 's/\"$$//g' ./options/locale/*.ini
5+
sed -i -e 's/\\\\\\\\\"/\"/g' ./options/locale/*.ini
6+
7+
# Remove translation under 25% of en_us
8+
baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
9+
baselines=$((baselines / 4))
10+
for filename in ./options/locale/*.ini; do
11+
lines=`wc -l "$filename" | cut -d" " -f1`
12+
if [ $lines -lt $baselines ]; then
13+
echo "Removing $filename: $lines/$baselines"
14+
rm "$filename"
15+
fi
16+
done
17+
18+
mv ./options/locale_en-US.ini ./options/locale/

0 commit comments

Comments
 (0)