michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: """This routine controls which localizable files and entries are michael@0: reported and l10n-merged. michael@0: This needs to stay in sync with the copy in mobile/android/locales. michael@0: """ michael@0: michael@0: def test(mod, path, entity = None): michael@0: import re michael@0: # ignore anything but mobile, which is our local repo checkout name michael@0: if mod not in ("netwerk", "dom", "toolkit", "security/manager", michael@0: "services/sync", "mobile", michael@0: "mobile/android/base", "mobile/android"): michael@0: return "ignore" michael@0: michael@0: if mod not in ("mobile", "mobile/android"): michael@0: # we only have exceptions for mobile* michael@0: return "error" michael@0: if mod == "mobile/android": michael@0: if not entity: michael@0: if (re.match(r"mobile-l10n.js", path) or michael@0: re.match(r"defines.inc", path)): michael@0: return "ignore" michael@0: if path == "defines.inc": michael@0: if entity == "MOZ_LANGPACK_CONTRIBUTORS": michael@0: return "ignore" michael@0: return "error" michael@0: michael@0: # we're in mod == "mobile" michael@0: if re.match(r"searchplugins\/.+\.xml", path): michael@0: return "ignore" michael@0: if path == "chrome/region.properties": michael@0: # only region.properties exceptions remain michael@0: if (re.match(r"browser\.search\.order\.[1-9]", entity) or michael@0: re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or michael@0: re.match(r"gecko\.handlerService\.schemes\.", entity) or michael@0: re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity)): michael@0: return "ignore" michael@0: michael@0: return "error"