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

[tor-commits] [torbutton/master] Bug 40001: Generate tor-browser-brand.ftl when importing translations



commit e486ef2454a7a9b3751407e3f5d532f939610a5d
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
Date:   Wed Apr 15 16:16:42 2020 +0200

    Bug 40001: Generate tor-browser-brand.ftl when importing translations
---
 chrome/locale/ar/branding/tor-browser-brand.ftl    |  4 +--
 chrome/locale/cs/branding/tor-browser-brand.ftl    |  2 +-
 chrome/locale/da/branding/tor-browser-brand.ftl    |  4 +--
 chrome/locale/es-ES/branding/tor-browser-brand.ftl |  2 +-
 chrome/locale/fa/branding/tor-browser-brand.ftl    |  8 ++---
 chrome/locale/fr/branding/tor-browser-brand.ftl    |  2 +-
 chrome/locale/hu/branding/tor-browser-brand.ftl    |  8 ++---
 chrome/locale/id/branding/tor-browser-brand.ftl    |  2 +-
 chrome/locale/lt/branding/tor-browser-brand.ftl    | 12 +++----
 chrome/locale/ms/branding/tor-browser-brand.ftl    | 12 +++----
 chrome/locale/nb-NO/branding/tor-browser-brand.ftl |  4 +--
 chrome/locale/nl/branding/tor-browser-brand.ftl    | 10 +++---
 chrome/locale/ru/branding/tor-browser-brand.ftl    |  2 +-
 chrome/locale/sv-SE/branding/tor-browser-brand.ftl |  2 +-
 chrome/locale/th/branding/tor-browser-brand.ftl    |  4 +--
 chrome/locale/tr/branding/tor-browser-brand.ftl    |  2 +-
 chrome/locale/zh-CN/branding/tor-browser-brand.ftl |  8 ++---
 chrome/locale/zh-TW/branding/tor-browser-brand.ftl |  4 +--
 import-translations.sh                             | 37 ++++++++++++++++++++++
 19 files changed, 83 insertions(+), 46 deletions(-)

diff --git a/chrome/locale/ar/branding/tor-browser-brand.ftl b/chrome/locale/ar/branding/tor-browser-brand.ftl
index 9595f702..1bcc7d0a 100644
--- a/chrome/locale/ar/branding/tor-browser-brand.ftl
+++ b/chrome/locale/ar/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = Ù?تصÙ?Ø­ تÙ?ر
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Ù?تصÙ?Ø­ تÙ?ر
+-brand-product-name = Ù?تصÙ?Ø­ Tor
 -vendor-short-name = Ù?شرÙ?ع تÙ?ر
-trademarkInfo = &quot;تÙ?ر&quot; Ù? &quot;شعار اÙ?بصÙ?Ø©&quot; عÙ?اÙ?ات تجارÙ?Ø© Ù?سجÙ?Ø© باسÙ? شرÙ?Ø© Ù?شرÙ?ع تÙ?ر اÙ?Ù?حدÙ?دة
+trademarkInfo = 'تÙ?ر' Ù? 'شعار اÙ?بصÙ?Ø©' عÙ?اÙ?ات تجارÙ?Ø© Ù?سجÙ?Ø© باسÙ? شرÙ?Ø© Ù?شرÙ?ع تÙ?ر اÙ?Ù?حدÙ?دة
diff --git a/chrome/locale/cs/branding/tor-browser-brand.ftl b/chrome/locale/cs/branding/tor-browser-brand.ftl
index 61719fb2..604c023d 100644
--- a/chrome/locale/cs/branding/tor-browser-brand.ftl
+++ b/chrome/locale/cs/branding/tor-browser-brand.ftl
@@ -9,4 +9,4 @@
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = ProhlížeÄ? Tor
 -vendor-short-name = Tor Project
-trademarkInfo = &quot;Tor&quot; a &quot;Onion logo&quot; jsou registrované ochranné známky spoleÄ?nosti Tor Project, Inc.
+trademarkInfo = Tor a logo Onion jsou ochrannými známkami spoleÄ?nosti Tor Project, Inc.
diff --git a/chrome/locale/da/branding/tor-browser-brand.ftl b/chrome/locale/da/branding/tor-browser-brand.ftl
index c8554742..65c61062 100644
--- a/chrome/locale/da/branding/tor-browser-brand.ftl
+++ b/chrome/locale/da/branding/tor-browser-brand.ftl
@@ -8,5 +8,5 @@
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
--vendor-short-name = Tor-projektet
-trademarkInfo = &quot;Tor&quot; og &quot;løg-logoet&quot; er registrerede varemærker tilhørende Tor Project, Inc.
+-vendor-short-name = Tor-projekt
+trademarkInfo = 'Tor' og 'løg-logoet' er registrerede varemærker tilhørende Tor Project, Inc.
diff --git a/chrome/locale/es-ES/branding/tor-browser-brand.ftl b/chrome/locale/es-ES/branding/tor-browser-brand.ftl
index 7c301ac8..6c35c786 100644
--- a/chrome/locale/es-ES/branding/tor-browser-brand.ftl
+++ b/chrome/locale/es-ES/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = Tor Browser
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
+-brand-product-name = Navegador Tor
 -vendor-short-name = Proyecto Tor
 trademarkInfo = 'Tor' y el 'Onion Logo' (logo de la cebolla) son marcas registradas de la Tor Project, Inc.
diff --git a/chrome/locale/fa/branding/tor-browser-brand.ftl b/chrome/locale/fa/branding/tor-browser-brand.ftl
index 11b305c4..67f426de 100644
--- a/chrome/locale/fa/branding/tor-browser-brand.ftl
+++ b/chrome/locale/fa/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Ù?رÙ?رگر تÙ?ر
--brand-short-name = Ù?رÙ?رگر تÙ?ر
--brand-full-name = Ù?رÙ?رگر تÙ?ر
+-brand-shorter-name = Ù?رÙ?رگر Tor
+-brand-short-name = Ù?رÙ?رگر Tor
+-brand-full-name = Ù?رÙ?رگر Tor
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Ù?رÙ?رگر تÙ?ر
--vendor-short-name = پرÙ?Ú?Ù?Ù? تÙ?ر
+-vendor-short-name = پرÙ?Ú?Ù? Tor
 trademarkInfo = 'Tor' Ù? 'Onion Logo' عÙ?اÙ?ت Ù?اÛ? تجارÛ? ثبت شدÙ? از پرÙ?Ú?Ù? Tor Ù?ستÙ?د
diff --git a/chrome/locale/fr/branding/tor-browser-brand.ftl b/chrome/locale/fr/branding/tor-browser-brand.ftl
index 293fa032..88f33470 100644
--- a/chrome/locale/fr/branding/tor-browser-brand.ftl
+++ b/chrome/locale/fr/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = Le Navigateur Tor
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Le Navigateur Tor
+-brand-product-name = Navigateur Tor
 -vendor-short-name = Le Projet Tor
 trademarkInfo = « Tor » et le « logo Onion » sont des marques de commerce de « The Projet Tor, Inc. »
diff --git a/chrome/locale/hu/branding/tor-browser-brand.ftl b/chrome/locale/hu/branding/tor-browser-brand.ftl
index ab8ff46d..399c1231 100644
--- a/chrome/locale/hu/branding/tor-browser-brand.ftl
+++ b/chrome/locale/hu/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Tor Browser
--brand-short-name = Tor Browser
--brand-full-name = Tor Browser
+-brand-shorter-name = Tor BöngészÅ?
+-brand-short-name = Tor BöngészÅ?
+-brand-full-name = Tor BöngészÅ?
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
+-brand-product-name = Tor BöngészÅ?
 -vendor-short-name = Tor Project
 trademarkInfo = A 'Tor' és az 'Onion Logo' a Tor Project, Inc. bejegyzett védjegyei.
diff --git a/chrome/locale/id/branding/tor-browser-brand.ftl b/chrome/locale/id/branding/tor-browser-brand.ftl
index b220851c..1724e411 100644
--- a/chrome/locale/id/branding/tor-browser-brand.ftl
+++ b/chrome/locale/id/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = Tor Browser
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
+-brand-product-name = Peramban Tor
 -vendor-short-name = Proyek Tor
 trademarkInfo = 'Tor' dan 'Logo Onion' adalah merek dagang terdaftar Tor Project, Inc.
diff --git a/chrome/locale/lt/branding/tor-browser-brand.ftl b/chrome/locale/lt/branding/tor-browser-brand.ftl
index af1fd648..aeebaec4 100644
--- a/chrome/locale/lt/branding/tor-browser-brand.ftl
+++ b/chrome/locale/lt/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Tor Browser
--brand-short-name = Tor Browser
--brand-full-name = Tor Browser
+-brand-shorter-name = Tor NarÅ¡yklÄ?
+-brand-short-name = Tor NarÅ¡yklÄ?
+-brand-full-name = Tor NarÅ¡yklÄ?
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
--vendor-short-name = Tor Project
-trademarkInfo = 'Tor' and the 'Onion Logo' are registered trademarks of the Tor Project, Inc.
+-brand-product-name = Tor NarÅ¡yklÄ?
+-vendor-short-name = Tor projektas
+trademarkInfo = 'Tor' ir 'Onion logotipas' yra registruoti Tor Project, Inc. prekių ženklai.
diff --git a/chrome/locale/ms/branding/tor-browser-brand.ftl b/chrome/locale/ms/branding/tor-browser-brand.ftl
index af1fd648..058e7c9a 100644
--- a/chrome/locale/ms/branding/tor-browser-brand.ftl
+++ b/chrome/locale/ms/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Tor Browser
--brand-short-name = Tor Browser
--brand-full-name = Tor Browser
+-brand-shorter-name = Pelayar Tor
+-brand-short-name = Pelayar Tor
+-brand-full-name = Pelayar Tor
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
--vendor-short-name = Tor Project
-trademarkInfo = 'Tor' and the 'Onion Logo' are registered trademarks of the Tor Project, Inc.
+-brand-product-name = Pelayar Tor
+-vendor-short-name = Projek Tor
+trademarkInfo = 'Tor' dan 'Logo Onion' adalah cap dagangan berdaftar bagi Projek Tor, Inc.
diff --git a/chrome/locale/nb-NO/branding/tor-browser-brand.ftl b/chrome/locale/nb-NO/branding/tor-browser-brand.ftl
index b09f8a20..8f5ec614 100644
--- a/chrome/locale/nb-NO/branding/tor-browser-brand.ftl
+++ b/chrome/locale/nb-NO/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = Tor-nettleseren
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor-nettleseren
+-brand-product-name = Tor Browser
 -vendor-short-name = Tor Project
-trademarkInfo = &quot;Tor&quot; og &quot;Løk-logoen&quot; er registrerte varemerker tilhørende the Tor Project, Inc.
+trademarkInfo = 'Tor' og 'Løk-logoen' er registrerte varemerker tilhørende the Tor Project, Inc.
diff --git a/chrome/locale/nl/branding/tor-browser-brand.ftl b/chrome/locale/nl/branding/tor-browser-brand.ftl
index 8ae5a2c6..77d51761 100644
--- a/chrome/locale/nl/branding/tor-browser-brand.ftl
+++ b/chrome/locale/nl/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Tor Browser
--brand-short-name = Tor Browser
--brand-full-name = Tor Browser
+-brand-shorter-name = Tor-browser
+-brand-short-name = Tor-browser
+-brand-full-name = Tor-browser
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
--vendor-short-name = Tor Project
-trademarkInfo = â??Torâ?? en het â??Onion-logoâ?? zijn geregistreerde handelsmerken van het Tor Project, Inc.
+-vendor-short-name = Tor-project
+trademarkInfo = â??Torâ?? en het â??Onion-logoâ?? zijn geregistreerde handelsmerken van Tor Project, Inc.
diff --git a/chrome/locale/ru/branding/tor-browser-brand.ftl b/chrome/locale/ru/branding/tor-browser-brand.ftl
index 44a1226e..c712a1b7 100644
--- a/chrome/locale/ru/branding/tor-browser-brand.ftl
+++ b/chrome/locale/ru/branding/tor-browser-brand.ftl
@@ -8,5 +8,5 @@
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
--vendor-short-name = Ð?Ñ?оекÑ? Tor
+-vendor-short-name = Tor Project
 trademarkInfo = 'Tor' и логоÑ?ип 'Onion' Ñ?влÑ?Ñ?Ñ?Ñ?Ñ? заÑ?егиÑ?Ñ?Ñ?иÑ?ованнÑ?ми Ñ?оÑ?говÑ?ми маÑ?ками Tor Project, Inc.
diff --git a/chrome/locale/sv-SE/branding/tor-browser-brand.ftl b/chrome/locale/sv-SE/branding/tor-browser-brand.ftl
index a7f08cfc..56cdff04 100644
--- a/chrome/locale/sv-SE/branding/tor-browser-brand.ftl
+++ b/chrome/locale/sv-SE/branding/tor-browser-brand.ftl
@@ -9,4 +9,4 @@
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
 -vendor-short-name = Tor-projektet
-trademarkInfo = 'Tor' och 'Onion Logotypen' är registerade varumärken av Tor Project, Inc.
+trademarkInfo = 'Tor' och 'Onion-logotypen' är registerade varumärken av Tor Project, Inc.
diff --git a/chrome/locale/th/branding/tor-browser-brand.ftl b/chrome/locale/th/branding/tor-browser-brand.ftl
index af1fd648..b1812e82 100644
--- a/chrome/locale/th/branding/tor-browser-brand.ftl
+++ b/chrome/locale/th/branding/tor-browser-brand.ftl
@@ -8,5 +8,5 @@
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
--vendor-short-name = Tor Project
-trademarkInfo = 'Tor' and the 'Onion Logo' are registered trademarks of the Tor Project, Inc.
+-vendor-short-name = ��ร��าร Tor
+trademarkInfo = 'Tor '�ละ' Onion Logo '������รื�อ�หมาย�าร��า���ะ��ีย��อ���ร��าร Tor Project, Inc.
diff --git a/chrome/locale/tr/branding/tor-browser-brand.ftl b/chrome/locale/tr/branding/tor-browser-brand.ftl
index 606a088b..d77b5427 100644
--- a/chrome/locale/tr/branding/tor-browser-brand.ftl
+++ b/chrome/locale/tr/branding/tor-browser-brand.ftl
@@ -9,4 +9,4 @@
 # remain unchanged across different versions (Nightly, Beta, etc.).
 -brand-product-name = Tor Browser
 -vendor-short-name = Tor Projesi
-trademarkInfo = 'Tor' ve 'Onion Logo' Tor Project, Inc. tarafından tescillenmiÅ? markalardır.
+trademarkInfo = 'Tor' ve 'Onion Logo' Tor Project, Inc. tarafından tescil edilmiÅ? markalardır.
diff --git a/chrome/locale/zh-CN/branding/tor-browser-brand.ftl b/chrome/locale/zh-CN/branding/tor-browser-brand.ftl
index acaab16c..bd16e2af 100644
--- a/chrome/locale/zh-CN/branding/tor-browser-brand.ftl
+++ b/chrome/locale/zh-CN/branding/tor-browser-brand.ftl
@@ -2,11 +2,11 @@
 # that is used by Firefox) to avoid picking up the -brand-short-name values
 # that Mozilla includes in the Firefox language packs.
 
--brand-shorter-name = Tor Browser
--brand-short-name = Tor Browser
--brand-full-name = Tor Browser
+-brand-shorter-name = Tor ���
+-brand-short-name = Tor ���
+-brand-full-name = Tor ���
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = Tor Browser
+-brand-product-name = Tor ���
 -vendor-short-name = Tor Project
 trademarkInfo = â??Torâ??å??â??Onion Logoâ??æ?¯ Tor Project, Inc ç??注å??å??æ ?ã??
diff --git a/chrome/locale/zh-TW/branding/tor-browser-brand.ftl b/chrome/locale/zh-TW/branding/tor-browser-brand.ftl
index 67938d57..eca78d7c 100644
--- a/chrome/locale/zh-TW/branding/tor-browser-brand.ftl
+++ b/chrome/locale/zh-TW/branding/tor-browser-brand.ftl
@@ -7,6 +7,6 @@
 -brand-full-name = æ´?è?¥è·¯ç?±ç??覽å?¨
 # This brand name can be used in messages where the product name needs to
 # remain unchanged across different versions (Nightly, Beta, etc.).
--brand-product-name = æ´?è?¥è·¯ç?±ç??覽å?¨
--vendor-short-name = ��路���
+-brand-product-name = Tor ç??覽å?¨
+-vendor-short-name = Tor ��
 trademarkInfo = ã??Torã??å??ã??Onion Logoã??ç??æ?¯ Tor Project, Inc ç??註å??å??æ¨?ã??
diff --git a/import-translations.sh b/import-translations.sh
index 06060a3c..78b4b8b9 100755
--- a/import-translations.sh
+++ b/import-translations.sh
@@ -64,6 +64,7 @@ else
 fi
 
 # Update each translated file for each locale.
+(
 echo "Locales: $BUNDLE_LOCALES"
 cd translation
 for KEYVAL in "${FILEMAP[@]}"; do
@@ -87,3 +88,39 @@ for KEYVAL in "${FILEMAP[@]}"; do
         $i/"$SRCFILE" > ../$LOCALE_DIR/$i/"$DEST_FILE"
   done
 done
+)
+
+# Autogenerate tor-browser-brand.ftl based on brand.properties
+# and brand.dtd.
+REGEX_ENTITY='<!ENTITY +([^" ]+) +"(.+)">';
+for LOCALE in $BUNDLE_LOCALES;
+do
+  BRAND_PATH="$LOCALE_DIR/$LOCALE/brand.properties"
+  BRAND_DTD_PATH="$LOCALE_DIR/$LOCALE/brand.dtd"
+  TOR_BRAND_PATH="$(dirname "$BRAND_PATH")/branding/tor-browser-brand.ftl"
+
+  BRAND_SHORTER_NAME="$(sed -n -e '/^brandShorterName/p' $BRAND_PATH | cut -d= -f2)"
+  BRAND_SHORT_NAME="$(sed -n -e '/^brandShortName/p' $BRAND_PATH | cut -d= -f2)"
+  BRAND_FULL_NAME="$(sed -n -e '/^brandFullName/p' $BRAND_PATH | cut -d= -f2)"
+  BRAND_PRODUCT_NAME="$(sed -n -e '/^brandProductName/p' $BRAND_PATH | cut -d= -f2)"
+  VENDOR_SHORT_NAME="$(sed -n -e '/^vendorShortName/p' $BRAND_PATH | cut -d= -f2)"
+  TRADEMARK_INFO='{ " " }'
+  if [[ "$(sed -n -e '/trademarkInfo/p' $BRAND_DTD_PATH)" =~ $REGEX_ENTITY ]]
+  then
+    # Replace some HTML entities (now just &quot;) for tor-browser-brand.ftl.
+    TRADEMARK_INFO="${BASH_REMATCH[2]//&quot;/\'}"
+  fi
+
+  echo "# For Tor Browser, we use a new file (different than the brand.ftl file" > $TOR_BRAND_PATH
+  echo "# that is used by Firefox) to avoid picking up the -brand-short-name values" >> $TOR_BRAND_PATH
+  echo "# that Mozilla includes in the Firefox language packs." >> $TOR_BRAND_PATH
+  echo "" >> $TOR_BRAND_PATH
+  echo "-brand-shorter-name = $BRAND_SHORTER_NAME" >> $TOR_BRAND_PATH
+  echo "-brand-short-name = $BRAND_SHORT_NAME" >> $TOR_BRAND_PATH
+  echo "-brand-full-name = $BRAND_FULL_NAME" >> $TOR_BRAND_PATH
+  echo "# This brand name can be used in messages where the product name needs to" >> $TOR_BRAND_PATH
+  echo "# remain unchanged across different versions (Nightly, Beta, etc.)." >> $TOR_BRAND_PATH
+  echo "-brand-product-name = $BRAND_PRODUCT_NAME" >> $TOR_BRAND_PATH
+  echo "-vendor-short-name = $VENDOR_SHORT_NAME" >> $TOR_BRAND_PATH
+  echo "trademarkInfo = $TRADEMARK_INFO" >> $TOR_BRAND_PATH
+done

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