From 407f92e9cff4f747ec58cc7703cce3ee98ef880f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Delphine=20Leb=C3=A9del?= Date: Fri, 31 Mar 2017 11:59:28 +0200 Subject: [PATCH] Bug 1036978 - Localization of un-used toolkit strings shouldn't be reported by compare-locales, r=Pike Change filter_py to only report on toolkit files referenced in mobile/locales/jar.mn. We ignore netwerk, security/manager, devtools/shared, services/sync on the module level. MozReview-Commit-ID: 4YRwZHUD1gE --HG-- extra : rebase_source : 2613456c9c3442ba2d27468fdc106c1778273f6f --- mobile/android/locales/filter.py | 39 +++++++++++++++++++++++++++++--- mobile/android/locales/jar.mn | 2 ++ mobile/locales/filter.py | 39 +++++++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 6 deletions(-) diff --git a/mobile/android/locales/filter.py b/mobile/android/locales/filter.py index 26f68d8f067e..1c1a79effd5a 100644 --- a/mobile/android/locales/filter.py +++ b/mobile/android/locales/filter.py @@ -10,12 +10,45 @@ This needs to stay in sync with the copy in mobile/locales. def test(mod, path, entity = None): import re # ignore anything but mobile, which is our local repo checkout name - if mod not in ("netwerk", "dom", "toolkit", "security/manager", - "devtools/shared", - "services/sync", "mobile", + if mod not in ("dom", "toolkit", "mobile", "mobile/android/base", "mobile/android"): return "ignore" + if mod == "toolkit": + # keep this file list in sync with jar.mn + if path in ( + "chrome/global/about.dtd", + "chrome/global/aboutAbout.dtd", + "chrome/global/aboutReader.properties", + "chrome/global/aboutRights.dtd", + "chrome/global/charsetMenu.properties", + "chrome/global/commonDialogs.properties", + "chrome/global/intl.properties", + "chrome/global/intl.css", + "chrome/passwordmgr/passwordmgr.properties", + "chrome/search/search.properties", + "chrome/pluginproblem/pluginproblem.dtd", + "chrome/global/aboutSupport.dtd", + "chrome/global/aboutSupport.properties", + "crashreporter/crashes.dtd", + "crashreporter/crashes.properties", + "chrome/global/mozilla.dtd", + "chrome/global/aboutTelemetry.dtd", + "chrome/global/aboutTelemetry.properties", + "chrome/global/aboutWebrtc.properties"): + return "error" + return "ignore" + + if mod == "dom": + # keep this file list in sync with jar.mn + if path in ( + "chrome/global.dtd", + "chrome/accessibility/AccessFu.properties", + "chrome/dom/dom.properties", + "chrome/plugins.properties"): + return "error" + return "ignore" + if mod not in ("mobile", "mobile/android"): # we only have exceptions for mobile* return "error" diff --git a/mobile/android/locales/jar.mn b/mobile/android/locales/jar.mn index 011e409c2cb2..7a3408fa7bd7 100644 --- a/mobile/android/locales/jar.mn +++ b/mobile/android/locales/jar.mn @@ -37,6 +37,7 @@ % resource search-plugins chrome://browser/locale/searchplugins/ # overrides for toolkit l10n, also for en-US +# keep this file list in sync with filter.py relativesrcdir toolkit/locales: locale/@AB_CD@/browser/overrides/about.dtd (%chrome/global/about.dtd) locale/@AB_CD@/browser/overrides/aboutAbout.dtd (%chrome/global/aboutAbout.dtd) @@ -86,6 +87,7 @@ relativesrcdir toolkit/locales: % override chrome://global/locale/aboutWebrtc.properties chrome://browser/locale/overrides/global/aboutWebrtc.properties # overrides for dom l10n, also for en-US +# keep this file list in sync with filter.py relativesrcdir dom/locales: locale/@AB_CD@/browser/overrides/global.dtd (%chrome/global.dtd) locale/@AB_CD@/browser/overrides/AccessFu.properties (%chrome/accessibility/AccessFu.properties) diff --git a/mobile/locales/filter.py b/mobile/locales/filter.py index c14c2d48e639..585e72b611e6 100644 --- a/mobile/locales/filter.py +++ b/mobile/locales/filter.py @@ -10,12 +10,45 @@ This needs to stay in sync with the copy in mobile/android/locales. def test(mod, path, entity = None): import re # ignore anything but mobile, which is our local repo checkout name - if mod not in ("netwerk", "dom", "toolkit", "security/manager", - "devtools/shared", - "services/sync", "mobile", + if mod not in ("dom", "toolkit", "mobile", "mobile/android/base", "mobile/android"): return "ignore" + if mod == "toolkit": + # keep this file list in sync with jar.mn + if path in ( + "chrome/global/about.dtd", + "chrome/global/aboutAbout.dtd", + "chrome/global/aboutReader.properties", + "chrome/global/aboutRights.dtd", + "chrome/global/charsetMenu.properties", + "chrome/global/commonDialogs.properties", + "chrome/global/intl.properties", + "chrome/global/intl.css", + "chrome/passwordmgr/passwordmgr.properties", + "chrome/search/search.properties", + "chrome/pluginproblem/pluginproblem.dtd", + "chrome/global/aboutSupport.dtd", + "chrome/global/aboutSupport.properties", + "crashreporter/crashes.dtd", + "crashreporter/crashes.properties", + "chrome/global/mozilla.dtd", + "chrome/global/aboutTelemetry.dtd", + "chrome/global/aboutTelemetry.properties", + "chrome/global/aboutWebrtc.properties"): + return "error" + return "ignore" + + if mod == "dom": + # keep this file list in sync with jar.mn + if path in ( + "chrome/global.dtd", + "chrome/accessibility/AccessFu.properties", + "chrome/dom/dom.properties", + "chrome/plugins.properties"): + return "error" + return "ignore" + if mod not in ("mobile", "mobile/android"): # we only have exceptions for mobile* return "error"