mobile/locales/filter.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 """
    10 def test(mod, path, entity = None):
    11   import re
    12   # ignore anything but mobile, which is our local repo checkout name
    13   if mod not in ("netwerk", "dom", "toolkit", "security/manager",
    14                  "services/sync", "mobile",
    15                  "mobile/android/base",  "mobile/android"):
    16     return "ignore"
    18   if mod not in ("mobile", "mobile/android"):
    19     # we only have exceptions for mobile*
    20     return "error"
    21   if mod == "mobile/android":
    22     if not entity:
    23       if (re.match(r"mobile-l10n.js", path) or
    24           re.match(r"defines.inc", path)):
    25         return "ignore"
    26     if path == "defines.inc":
    27       if entity == "MOZ_LANGPACK_CONTRIBUTORS":
    28         return "ignore"
    29     return "error"
    31   # we're in mod == "mobile"
    32   if re.match(r"searchplugins\/.+\.xml", path):
    33     return "ignore"
    34   if path == "chrome/region.properties":
    35     # only region.properties exceptions remain
    36     if (re.match(r"browser\.search\.order\.[1-9]", entity) or
    37         re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
    38         re.match(r"gecko\.handlerService\.schemes\.", entity) or
    39       re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity)):
    40       return "ignore"
    42   return "error"

mercurial