suite/locales/filter.py
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Tue, 07 Feb 2023 08:39:05 +0000
changeset 49273 ae7179d4eea5afad2f28e71874117c577b8e8224
parent 40900 649dfb319e7abe11c96b98c6607af01d1ddf8b82
permissions -rw-r--r--
no bug - Bumping Thunderbird l10n changesets r=release a=l10n-bump DONTBUILD af -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ar -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ast -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 be -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 bg -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 br -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ca -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 cak -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 cs -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 cy -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 da -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 de -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 dsb -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 el -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 en-CA -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 en-GB -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 es-AR -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 es-ES -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 es-MX -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 et -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 eu -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 fi -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 fr -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 fy-NL -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ga-IE -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 gd -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 gl -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 he -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 hr -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 hsb -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 hu -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 hy-AM -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 id -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 is -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 it -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ja -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ja-JP-mac -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ka -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 kab -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 kk -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ko -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 lt -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 lv -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ms -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 nb-NO -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 nl -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 nn-NO -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 pa-IN -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 pl -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 pt-BR -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 pt-PT -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 rm -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ro -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 ru -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 sk -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 sl -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 sq -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 sr -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 sv-SE -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 th -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 tr -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 uk -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 uz -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 vi -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 zh-CN -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1 zh-TW -> 26d32fd73807fc0f60d0a8ff557e7cd9c5ff93e1

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


def test(mod, path, entity=None):
    import re

    # ignore anything but SeaMonkey
    if mod not in (
        "netwerk",
        "dom",
        "toolkit",
        "security/manager",
        "devtools/client",
        "devtools/shared",
        "devtools/startup",
        "suite",
        "extensions/spellcheck",
        "suite/branding/seamonkey",
        "services/sync",
    ):
        return "ignore"
    # ignore temporary files, hiden files and files from rejects
    if (
        re.match(r".*?\/[.#].+", path)
        or re.match(r".*~$", path)
        or re.match(r".+\.(orig|rej)", path)
    ):
        return "ignore"
    if mod not in ("suite"):
        # we only have exceptions for suite
        return "error"
    if entity is None:
        # missing and obsolete files
        return (
            "ignore"
            if (
                re.match(r"searchplugins\/.+\.xml", path)
                or path == "profile/bookmarks.extra"
                or path == "profile/panels.extra"
                or path == "defines.inc"
                or re.match(r"chrome\/common\/help\/images\/[A-Za-z-_]+\.[a-z]+", path)
            )
            else "error"
        )
    if path == "defines.inc":
        return "ignore" if (entity == "MOZ_LANGPACK_CONTRIBUTORS") else "error"

    if path == "chrome/common/region.properties":
        return (
            "ignore"
            if (re.match(r"browser\.search\.order\.[1-9]", entity))
            else "error"
        )

    if path == "chrome/mailnews/region.properties":
        return (
            "ignore"
            if (re.match(r"mail\.addr_book\.mapit_url\.[1-5]", entity))
            else "error"
        )

    if path != "chrome/browser/region.properties":
        # only region.properties exceptions remain, compare all others
        return "error"

    return (
        "ignore"
        if (re.match(r"browser\.contentHandlers\.types\.[0-5]", entity))
        else "error"
    )