[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [translation-tools/master] Check for unescaped characters in fenix translations



commit f0160f12407cb019bbaf680c9aded208181281c2
Author: Nicolas Vigier <boklm@xxxxxxxxxxxxxx>
Date:   Tue Feb 22 11:52:05 2022 +0100

    Check for unescaped characters in fenix translations
    
    For tor-browser#40367
---
 update_translations | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/update_translations b/update_translations
index ccec8fa..fbe3aef 100755
--- a/update_translations
+++ b/update_translations
@@ -19,6 +19,9 @@ echo ${PID} > ${PIDFILE}
 # Prepare the repository by making sure it is up to date.
 cd $TRANSLATION_REPO
 
+unescaped_files=$(mktemp)
+trap 'rm -f $unescaped_files' EXIT
+
 # For each project, fetch the new translations and commit
 # if there are any changes.
 
@@ -37,6 +40,17 @@ for project in $PROJECTS; do
   # Fetch new translations for this project ...
   $TX pull -a -s $TX_PULL_OPTS > /dev/null;
 
+  if test "$project" = "fenix-torbrowserstringsxml" || test "$project" = "fenix-torbrowserstringsxml_completed"
+  then
+    find . -name '*.xml' -exec grep -H "[^\\]'" {} \; > "$unescaped_files"
+    if ! test -z "$(cat $unescaped_files)"
+    then
+      cat $unescaped_files | mail -s "Unescaped files in $project" emmapeel@xxxxxxxxxxxxxx boklm@xxxxxxxxxxxxxx
+      cd ..
+      continue
+    fi
+  fi
+
   # ... add them to git ...
   git add -A . > /dev/null;
   git commit -qm "new translations in $project" > /dev/null || test $? = 1;

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits