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
--- a/mobile/android/locales/filter.py
+++ b/mobile/android/locales/filter.py
@@ -5,22 +5,55 @@
"""This routine controls which localizable files and entries are
reported and l10n-merged.
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"
if mod == "mobile/android":
if not entity:
if (re.match(r"mobile-l10n.js", path) or
re.match(r"defines.inc", path)):
return "ignore"
--- a/mobile/android/locales/jar.mn
+++ b/mobile/android/locales/jar.mn
@@ -32,16 +32,17 @@
locale/@AB_CD@/browser/aboutLogins.dtd (%chrome/aboutLogins.dtd)
locale/@AB_CD@/browser/aboutLogins.properties (%chrome/aboutLogins.properties)
#ifndef RELEASE_OR_BETA
locale/@AB_CD@/browser/webcompatReporter.properties (%chrome/webcompatReporter.properties)
#endif
% 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)
locale/@AB_CD@/browser/overrides/aboutReader.properties (%chrome/global/aboutReader.properties)
locale/@AB_CD@/browser/overrides/aboutRights.dtd (%chrome/global/aboutRights.dtd)
locale/@AB_CD@/browser/overrides/charsetMenu.properties (%chrome/global/charsetMenu.properties)
locale/@AB_CD@/browser/overrides/commonDialogs.properties (%chrome/global/commonDialogs.properties)
locale/@AB_CD@/browser/overrides/intl.properties (%chrome/global/intl.properties)
@@ -81,16 +82,17 @@ relativesrcdir toolkit/locales:
% override chrome://global/locale/crashes.dtd chrome://browser/locale/overrides/crashreporter/crashes.dtd
% override chrome://global/locale/crashes.properties chrome://browser/locale/overrides/crashreporter/crashes.properties
% override chrome://global/locale/mozilla.dtd chrome://browser/locale/overrides/global/mozilla.dtd
% override chrome://global/locale/aboutTelemetry.dtd chrome://browser/locale/overrides/global/aboutTelemetry.dtd
% override chrome://global/locale/aboutTelemetry.properties chrome://browser/locale/overrides/global/aboutTelemetry.properties
% 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)
locale/@AB_CD@/browser/overrides/dom/dom.properties (%chrome/dom/dom.properties)
#about:plugins
locale/@AB_CD@/browser/overrides/plugins.properties (%chrome/plugins.properties)
% override chrome://global/locale/global.dtd chrome://browser/locale/overrides/global.dtd
--- a/mobile/locales/filter.py
+++ b/mobile/locales/filter.py
@@ -5,22 +5,55 @@
"""This routine controls which localizable files and entries are
reported and l10n-merged.
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"
if mod == "mobile/android":
if not entity:
if (re.match(r"mobile-l10n.js", path) or
re.match(r"defines.inc", path)):
return "ignore"