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

gk at torproject.org gk at torproject.org
Wed Jul 8 12:11:59 UTC 2020


commit e486ef2454a7a9b3751407e3f5d532f939610a5d
Author: Alex Catarineu <acat at torproject.org>
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 = "تور" و "شعار البصلة" علامات تجارية مسجلة باسم شركة مشروع تور المحدودة
+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 = "Tor" a "Onion logo" 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 = "Tor" og "løg-logoet" 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 = "Tor" og "Løk-logoen" 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 ") for tor-browser-brand.ftl.
+    TRADEMARK_INFO="${BASH_REMATCH[2]//"/\'}"
+  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



More information about the tor-commits mailing list