mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-17 01:20:37 +00:00
Use flatten translation keys (#36225)
Crowdin does not remove empty lines in nested JSON translation files. Therefore, we use flattened translation keys instead. We have also updated the key-loading logic to ensure that empty values are not applied during translation. --------- Signed-off-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -9,11 +9,11 @@ fi
|
||||
mv ./options/locale/locale_en-US.json ./options/
|
||||
|
||||
# Remove translation under 25% of en_us
|
||||
baselines=$(wc -l "./options/locale_en-US.json" | cut -d" " -f1)
|
||||
baselines=$(cat "./options/locale_en-US.json" | wc -l)
|
||||
baselines=$((baselines / 4))
|
||||
for filename in ./options/locale/*.json; do
|
||||
lines=$(wc -l "$filename" | cut -d" " -f1)
|
||||
if [ $lines -lt $baselines ]; then
|
||||
lines=$(cat "$filename" | wc -l)
|
||||
if [ "$lines" -lt "$baselines" ]; then
|
||||
echo "Removing $filename: $lines/$baselines"
|
||||
rm "$filename"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user