[tbb-commits] [torbutton/master] Bug 16268: Taking lower-case into account
gk at torproject.org
gk at torproject.org
Tue Jul 28 17:02:53 UTC 2015
commit 03cf87e2a76d15016703de631ca5140e42fdb1f4
Author: Georg Koppen <gk at torproject.org>
Date: Tue Jul 28 17:01:55 2015 +0000
Bug 16268: Taking lower-case into account
Patch by Pearl Crescent
---
trans_tools/import-translations.sh | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/trans_tools/import-translations.sh b/trans_tools/import-translations.sh
index 28816ff..ae686b4 100755
--- a/trans_tools/import-translations.sh
+++ b/trans_tools/import-translations.sh
@@ -66,18 +66,24 @@ fi
echo "Locales: $BUNDLE_LOCALES"
cd translation
for KEYVAL in "${FILEMAP[@]}"; do
- FILE="${KEYVAL%%:*}"
+ DEST_FILE="${KEYVAL%%:*}"
BRANCH="${KEYVAL##*:}"
- echo "Updating ${FILE}..."
+ echo "Updating ${DEST_FILE}..."
git checkout -q "$BRANCH"
git merge -q origin/"$BRANCH"
for i in $BUNDLE_LOCALES;
do
UL="`echo $i|tr - _`"
mkdir -p ../$LOCALE_DIR/$i/
+# Some file names are lowercase in Transifex.
+ if [ -f $UL/"$DEST_FILE" ]; then
+ SRCFILE="$DEST_FILE"
+ else
+ SRCFILE="`echo $DEST_FILE | tr '[:upper:]' '[:lower:]'`"
+ fi
# Use sed to work around a Transifex "double entity" issue.
sed -e 's/\&brandShortName;/\&brandShortName;/g' \
-e 's/\&vendorShortName;/\&vendorShortName;/g' \
- $UL/"$FILE" > ../$LOCALE_DIR/$i/"$FILE"
+ $UL/"$SRCFILE" > ../$LOCALE_DIR/$i/"$DEST_FILE"
done
done
More information about the tbb-commits
mailing list