calendar/locales/filter.py
author Philipp Kewisch <mozilla@kewis.ch>
Sun, 14 Jan 2018 13:03:57 +0100
changeset 58730 07e9ccb0dc2714f6f387efec1ccddc83fd4a5fb4
parent 27528 4d26b2425cfe18df52b3667eb82007dabe66ed39
child 79870 d58d9fbdca017d16d2f1bbd23cc53a92447e0b2b
permissions -rw-r--r--
Bug 1429452 - Add Persian language to Thunderbird nightly build. r=tomprince MozReview-Commit-ID: DD7O9R2yAl3


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

  # ignore anything but calendar stuff
  if mod not in ("netwerk", "dom", "toolkit", "security/manager",
                 "calendar"):
    return False

  # Timezone properties don't have to be translated
  if path == "chrome/calendar/timezones.properties":
    return "report"

  # Noun class entries do not have to be translated
  if path == "chrome/calendar/calendar-event-dialog.properties":
    return not re.match(r".*Nounclass[1-9]", entity)

  # most extraction related strings are not required
  if path == "chrome/calendar/calendar-extract.properties":
    if not re.match(r"from.today", entity):
      return "report"

  # Provider for Google Calendar AMO strings do not have to be translated
  if path == "chrome/calendar/providers/gdata/amo.properties":
    return "report"

  # Everything else should be taken into account
  return True