Skip to content

Commit

Permalink
Fix crowdin update script (go-gitea#9969)
Browse files Browse the repository at this point in the history
* Fix crowdin update script

* Refine the script to be specific about what it should change

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
2 people authored and techknowlogick committed Jan 25, 2020
1 parent 9d57569 commit a47cfdf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/update-locales.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/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

# Make sure to only change lines that have the translation enclosed between quotes
sed -i -r -e '/^[a-zA-Z0-9_-.]+[ ]*=[ ]*".*"$/ {
s/^([a-zA-Z0-9_-.]+)[ ]*="/\1=/
s/\\"/"/g
s/"$//
}' ./options/locale/*.ini

# Remove translation under 25% of en_us
baselines=`wc -l "./options/locale_en-US.ini" | cut -d" " -f1`
Expand Down

0 comments on commit a47cfdf

Please sign in to comment.