diff options
Diffstat (limited to 'crowdin')
| -rwxr-xr-x | crowdin/download | 8 | ||||
| -rwxr-xr-x | crowdin/globals | 2 | ||||
| -rwxr-xr-x | crowdin/local-patches | 14 |
3 files changed, 23 insertions, 1 deletions
diff --git a/crowdin/download b/crowdin/download index 89483c5..6a45c83 100755 --- a/crowdin/download +++ b/crowdin/download @@ -62,6 +62,14 @@ _do wget "http://api.crowdin.net/api/project/cgeo/download/all.zip?key=${CROWDIN || die "crowdin download failed." _do unzip -o ${ZIPFILE} || die "unzip of ${ZIPFILE} failed." +# fix unicode entities for ellipsis character +for f in */*/*values-*/strings.xml; do + sed -i 's/…/…/g' $f +done + +# apply local patches to particular strings +. "`dirname $0`/local-patches" + # check for changes if [ -z "`git diff`" ]; then debug "no changes, finishing." diff --git a/crowdin/globals b/crowdin/globals index 0efd147..dc2e9c9 100755 --- a/crowdin/globals +++ b/crowdin/globals @@ -37,7 +37,7 @@ debug () { echo "`date +%Y-%m-%d.%H:%M:%S` `basename $0`: $@"; } # use this function for executing commands. _do () { debug "$@"; eval "$@"; } -require_tools git curl wget unzip +require_tools git curl wget unzip sed git rev-parse --show-toplevel >& /dev/null || die "Please start this script from within a repo. Aborting." cd "`git rev-parse --show-toplevel`" diff --git a/crowdin/local-patches b/crowdin/local-patches new file mode 100755 index 0000000..d671c81 --- /dev/null +++ b/crowdin/local-patches @@ -0,0 +1,14 @@ +# +# This file contains special handlings that must be done on +# crowdin strings. For example, some sentences must get a +# ignore-typo flag so that lint does not give a false +# positive. +# +# All the fixes should be idempotent so that this script can be applied +# to the fixed version as well. + +# Fix a lint confusion between Portuguese word "com" and "geocaching.com" +# name, which can be flagged as a repetition of the same word. + +sed -i -e '/geocaching\.com com/s/\(<string name="[^"]*"\)>/\1 tools:ignore="Typos">/' \ + main/res/values-pt/strings.xml |
