bug 1372167, toml l10n configs for Thunderbird, Calendar, SeaMonkey, r=Fallen, ewong
authorAxel Hecht <axel@pike.org>
Mon, 12 Jun 2017 14:07:54 +0200
changeset 52147 bd78c240ad996e5b46ba87f4b85ca8dd385a2c39
parent 52143 e164cc084e8fc75d967652f7e9ff48436b33d619
child 52148 ea17e74e9fe364786ad0e7b06c8a2eb385938fca
push id4641
push userMozilla@Adrario.de
push dateWed, 28 Jun 2017 12:17:13 +0000
treeherdertry-comm-central@7d52df35197f [default view] [failures only]
reviewersFallen, ewong
bugs1372167
bug 1372167, toml l10n configs for Thunderbird, Calendar, SeaMonkey, r=Fallen, ewong The configs just match what the ini configs do. For SeaMonkey, there were some bugs in filter.py that I fixed along the way. Some file path checks were in unreachable parts, and some file checks were missing. I intentionally dropped the ignore flags for bad editor backups, too, those should really just be reported, so that they don't slip in. Also, most editors don't create those no more. MozReview-Commit-ID: 6m2yid3nGZq
calendar/locales/l10n.toml
mail/build.mk
mail/locales/Makefile.in
mail/locales/l10n.toml
suite/locales/filter.py
suite/locales/l10n.toml
new file mode 100644
--- /dev/null
+++ b/calendar/locales/l10n.toml
@@ -0,0 +1,89 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+basepath = "../.."
+
+locales = [
+    "ar",
+    "bg",
+    "br",
+    "ca",
+    "cs",
+    "cy",
+    "da",
+    "de",
+    "dsb",
+    "en-GB",
+    "es-AR",
+    "es-ES",
+    "et",
+    "eu",
+    "fi",
+    "fr",
+    "fy-NL",
+    "ga-IE",
+    "gd",
+    "gl",
+    "he",
+    "hr",
+    "hsb",
+    "hu",
+    "id",
+    "is",
+    "it",
+    "ja",
+    "ja-JP-mac",
+    "ka",
+    "kab",
+    "ko",
+    "lt",
+    "nb-NO",
+    "nl",
+    "nn-NO",
+    "pa-IN",
+    "pl",
+    "pt-PT",
+    "rm",
+    "ro",
+    "ru",
+    "sk",
+    "sl",
+    "sq",
+    "sv-SE",
+    "tr",
+    "uk",
+    "zh-CN",
+    "zh-TW",
+]
+
+[env]
+    l = "{l10n_base}/{locale}/"
+
+[[paths]]
+    reference = "calendar/locales/en-US/**"
+    l10n = "{l}calendar/**"
+
+# Timezone properties don't have to be translated
+[[filters]]
+    path = "{l}calendar/chrome/calendar/timezones.properties"
+    key = "re:."
+    action = "warning"
+
+# Noun class entries do not have to be translated
+[[filters]]
+    path = "{l}calendar/chrome/calendar/calendar-event-dialog.properties"
+    key = "re:.*Nounclass[1-9].*"
+    action = "ignore"
+
+# most extraction related strings are not required
+[[filters]]
+    path = "{l}calendar/chrome/calendar/calendar-extract.properties"
+    key = "re:.*from\\.today.*"
+    action = "warning"
+
+# Provider for Google Calendar AMO strings do not have to be translated
+[[filters]]
+    path = "{l}calendar/chrome/calendar/providers/gdata/amo.properties"
+    key = "re:."
+    action = "warning"
--- a/mail/build.mk
+++ b/mail/build.mk
@@ -32,12 +32,20 @@ source-upload::
 	@$(MAKE) -C mail/installer source-upload
 
 hg-bundle::
 	@$(MAKE) -C mail/installer hg-bundle
 
 l10n-check::
 	@$(MAKE) -C mail/locales l10n-check
 
+wget-en-US:
+	$(MAKE) -C mail/locales wget-en-US
+
+# make -j1 because dependencies in l10n build targets don't work
+# with parallel builds
+merge-% installers-% langpack-% chrome-%:
+	$(MAKE) -j1 -C mail/locales $@
+
 ifdef ENABLE_TESTS
 include $(topsrcdir)/../mail/testsuite-targets.mk
 endif
 endif
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -18,16 +18,20 @@ PWD := $(CURDIR)
 
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files.
 ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
 WIN32_INSTALLER_IN ?= $(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 RETRIEVE_WINDOWS_INSTALLER = 1
 
 MOZ_LANGPACK_EID=langpack-$(AB_CD)@thunderbird.mozilla.org
+# For Nightly, we know where to get the builds from to do local repacks
+ifdef NIGHTLY_BUILD
+EN_US_BINARY_URL=https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central
+endif
 
 L10N_PREF_JS_EXPORTS = $(call MERGE_FILE,all-l10n.js)
 L10N_PREF_JS_EXPORTS_PATH = $(FINAL_TARGET)/$(PREF_DIR)
 L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warnings
 PP_TARGETS += L10N_PREF_JS_EXPORTS
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
@@ -174,23 +178,16 @@ endif
 # Move the windows installer
 ifeq (WINNT, $(OS_ARCH))
 	mv "$(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe" \
 	   "$(UPLOAD_DIR)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
 endif
 # Set the permissions that the folders will have in ftp once uploaded
 	chmod -vR 775 $(UPLOAD_DIR)
 
-merge-%:
-ifdef LOCALE_MERGEDIR
-	$(RM) -rf $(LOCALE_MERGEDIR)
-	$(MOZILLA_SRCDIR)/mach compare-locales --merge-dir $(LOCALE_MERGEDIR) --l10n-ini $(srcdir)/l10n.ini $*
-endif
-	@echo
-
 # test target, depends on make package
 # try to repack x-test, with just toolkit/defines.inc being there
 l10n-check::
 	$(RM) -rf x-test
 	$(NSINSTALL) -D x-test/toolkit
 	echo '#define MOZ_LANG_TITLE Just testing' > x-test/toolkit/defines.inc
 	$(MAKE) installers-x-test L10NBASEDIR='$(PWD)' LOCALE_MERGEDIR='$(PWD)/mergedir'
 
new file mode 100644
--- /dev/null
+++ b/mail/locales/l10n.toml
@@ -0,0 +1,122 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+basepath = "../.."
+
+locales = [
+    "af",
+    "ar",
+    "ast",
+    "be",
+    "bg",
+    "bn-BD",
+    "br",
+    "ca",
+    "cs",
+    "cy",
+    "da",
+    "de",
+    "dsb",
+    "el",
+    "en-GB",
+    "es-AR",
+    "es-ES",
+    "et",
+    "eu",
+    "fi",
+    "fr",
+    "fy-NL",
+    "ga-IE",
+    "gd",
+    "gl",
+    "he",
+    "hr",
+    "hsb",
+    "hu",
+    "hy-AM",
+    "id",
+    "is",
+    "it",
+    "ja",
+    "ja-JP-mac",
+    "ka",
+    "kab",
+    "ko",
+    "lt",
+    "nb-NO",
+    "nl",
+    "nn-NO",
+    "pa-IN",
+    "pl",
+    "pt-BR",
+    "pt-PT",
+    "rm",
+    "ro",
+    "ru",
+    "si",
+    "sk",
+    "sl",
+    "sq",
+    "sr",
+    "sv-SE",
+    "ta-LK",
+    "tr",
+    "uk",
+    "vi",
+    "zh-CN",
+    "zh-TW",
+]
+
+[env]
+    l = "{l10n_base}/{locale}/"
+    mozilla = "mozilla"
+
+
+[[paths]]
+    reference = "mail/locales/en-US/**"
+    l10n = "{l}mail/**"
+
+[[paths]]
+    reference = "chat/locales/en-US/**"
+    l10n = "{l}chat/**"
+
+[[paths]]
+    reference = "editor/ui/locales/en-US/**"
+    l10n = "{l}editor/ui/**"
+
+[[paths]]
+    reference = "other-licenses/branding/thunderbird/locales/en-US/**"
+    l10n = "{l}other-licenses/branding/thunderbird/**"
+
+[[includes]]
+    path = "{mozilla}/devtools/client/locales/l10n.toml"
+
+[[includes]]
+    path = "{mozilla}/toolkit/locales/l10n.toml"
+
+
+# ignore MOZ_LANGPACK_CONTRIBUTORS
+[[filters]]
+    path = "{l}mail/defines.inc"
+    key = "MOZ_LANGPACK_CONTRIBUTORS"
+    action = "ignore"
+
+# defines.inc and all-l10n.js can be missing completely
+[[filters]]
+    path = [
+        "{l}mail/defines.inc",
+        "{l}mail/all-l10n.js",
+    ]
+    action = "ignore"
+
+# search prefs don't have the same number for all locales
+[[filters]]
+    path = "{l}mail/chrome/messenger-region/region.properties"
+    key = "re:browser\\.search\\.order\\.[1-9].*"
+    action = "ignore"
+
+# search plugins are different per locale, ignore file difference
+[[filters]]
+    path = "{l}mail/searchplugins/*.xml"
+    action = "ignore"
--- a/suite/locales/filter.py
+++ b/suite/locales/filter.py
@@ -15,24 +15,25 @@ def test(mod, path, entity=None):
       re.match(r".+\.(orig|rej)", path)):
     return "ignore"
   if mod not in ("suite"):
     # we only have exceptions for suite
     return "error"
   if entity is None:
     # missing and obsolete files
     return ("ignore" if (re.match(r"searchplugins\/.+\.xml", path) or
+                         path == "profile/bookmarks.extra" or
+                         path == "profile/panels.extra" or
+                         path == "defines.inc" or
+                         path == "suite-l10n.js" or
                          re.match(r"chrome\/common\/help\/images\/[A-Za-z-_]+\.[a-z]+", path))
             else "error")
   if path == "defines.inc":
     return ("ignore" if (entity == "MOZ_LANGPACK_CONTRIBUTORS")
             else "error")
-  if path == "profile/bookmarks.extra" or path == "profile/panels.extra":
-    # ignore files for additional bookmarks and panels
-    return "ignore"
 
   if path == "chrome/common/region.properties":
     return ("ignore" if (re.match(r"browser\.search\.order\.[1-9]", entity))
             else "error")
 
   if path != "chrome/browser/region.properties":
     # only region.properties exceptions remain, compare all others
     return "error"
new file mode 100644
--- /dev/null
+++ b/suite/locales/l10n.toml
@@ -0,0 +1,103 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+basepath = "../.."
+
+locales = [
+    "ca",
+    "cs",
+    "da",
+    "de",
+    "en-GB",
+    "es-AR",
+    "es-ES",
+    "fi",
+    "fr",
+    "gl",
+    "hu",
+    "it",
+    "ja",
+    "ja-JP-mac",
+    "ka",
+    "lt",
+    "nb-NO",
+    "nl",
+    "pl",
+    "pt-BR",
+    "pt-PT",
+    "ro",
+    "ru",
+    "si",
+    "sk",
+    "sv-SE",
+    "tr",
+    "uk",
+    "zh-CN",
+    "zh-TW",
+]
+
+[env]
+    l = "{l10n_base}/{locale}/"
+    mozilla = "mozilla"
+
+
+[[paths]]
+    reference = "suite/locales/en-US/**"
+    l10n = "{l}suite/**"
+
+[[paths]]
+    reference = "editor/ui/locales/en-US/**"
+    l10n = "{l}editor/ui/**"
+
+[[paths]]
+    reference = "{mozilla}/services/sync/locales/en-US/**"
+    l10n = "{l}services/sync/**"
+
+
+[[includes]]
+    path = "{mozilla}/devtools/client/locales/l10n.toml"
+
+[[includes]]
+    path = "{mozilla}/toolkit/locales/l10n.toml"
+
+
+# ignore MOZ_LANGPACK_CONTRIBUTORS
+[[filters]]
+    path = "{l}suite/defines.inc"
+    key = "MOZ_LANGPACK_CONTRIBUTORS"
+    action = "ignore"
+
+# defines.inc and all-l10n.js can be missing completely
+[[filters]]
+    path = [
+        "{l}suite/defines.inc",
+        "{l}suite/suite-l10n.js",
+    ]
+    action = "ignore"
+
+# search prefs don't have the same number for all locales
+[[filters]]
+    path = "{l}suite/chrome/common/region.properties"
+    key = "re:browser\\.search\\.order\\.[1-9].*"
+    action = "ignore"
+
+# content handler prefs don't have the same number for all locales
+[[filters]]
+    path = "{l}suite/chrome/browser/region.properties"
+    key = "re:browser\\.contentHandlers\\.types\\.[0-5].*"
+    action = "ignore"
+
+# search plugins are different per locale, ignore file difference
+[[filters]]
+    path = "{l}suite/searchplugins/*.xml"
+    action = "ignore"
+
+# extra data and help images are optional
+[[filters]]
+    path = [
+        "{l}suite/profile/bookmarks.extra",
+        "{l}suite/profile/panels.extra",
+        "{l}suite/chrome/common/help/images/*.*",
+    ]
+    action = "ignore"