no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / mobile / locales / filter.py
blob38b4bbb50d034510b5ecc0f47599137d97dfa0b9
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 """This routine controls which localizable files and entries are
6 reported and l10n-merged.
7 This needs to stay in sync with the copy in mobile/android/locales.
8 """
11 def test(mod, path, entity=None):
12 import re
14 # ignore anything but mobile, which is our local repo checkout name
15 if mod not in ("dom", "toolkit", "mobile", "mobile/android"):
16 return "ignore"
18 if mod == "toolkit":
19 # keep this file list in sync with jar.mn
20 if path in (
21 "chrome/global/commonDialogs.properties",
22 "chrome/global/intl.properties",
23 "chrome/global/intl.css",
25 return "error"
26 if re.match(r"crashreporter/[^/]*.ftl", path):
27 # error on crashreporter/*.ftl
28 return "error"
30 if re.match(r"toolkit/about/[^/]*About.ftl", path):
31 # error on toolkit/about/*About.ftl
32 return "error"
33 if re.match(r"toolkit/about/[^/]*Mozilla.ftl", path):
34 # error on toolkit/about/*Mozilla.ftl
35 return "error"
36 if re.match(r"toolkit/about/[^/]*Rights.ftl", path):
37 # error on toolkit/about/*Rights.ftl
38 return "error"
39 if re.match(r"toolkit/about/[^/]*Compat.ftl", path):
40 # error on toolkit/about/*Compat.ftl
41 return "error"
42 if re.match(r"toolkit/about/[^/]*Support.ftl", path):
43 # error on toolkit/about/*Support.ftl
44 return "error"
45 if re.match(r"toolkit/about/[^/]*Webrtc.ftl", path):
46 # error on toolkit/about/*Webrtc.ftl
47 return "error"
48 return "ignore"
50 if mod == "dom":
51 # keep this file list in sync with jar.mn
52 if path in (
53 "chrome/accessibility/AccessFu.properties",
54 "chrome/dom/dom.properties",
56 return "error"
57 return "ignore"
59 if mod not in ("mobile", "mobile/android"):
60 # we only have exceptions for mobile*
61 return "error"
62 if mod == "mobile/android":
63 if entity is None:
64 if re.match(r"mobile-l10n.js", path):
65 return "ignore"
66 return "error"
68 return "error"