You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

update-locales.sh 655B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. mv ./options/locale/locale_en-US.ini ./options/
  3. # Make sure to only change lines that have the translation enclosed between quotes
  4. sed -i -r -e '/^[a-zA-Z0-9_.-]+[ ]*=[ ]*".*"$/ {
  5. s/^([a-zA-Z0-9_.-]+)[ ]*="/\1=/
  6. s/\\"/"/g
  7. s/"$//
  8. }' ./options/locale/*.ini
  9. # Remove translation under 25% of en_us
  10. baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
  11. baselines=$((baselines / 4))
  12. for filename in ./options/locale/*.ini; do
  13. lines=`wc -l "$filename" | cut -d" " -f1`
  14. if [ $lines -lt $baselines ]; then
  15. echo "Removing $filename: $lines/$baselines"
  16. rm "$filename"
  17. fi
  18. done
  19. mv ./options/locale_en-US.ini ./options/locale/