calendar/locales/filter.py
author Joshua Cranmer <Pidgeot18@gmail.com>
Sun, 19 Apr 2015 22:20:41 -0500
changeset 22480 2b00be2ded7f6b20d5b10523f73ff29bb02edd43
parent 21556 4d26b2425cfe18df52b3667eb82007dabe66ed39
permissions -rw-r--r--
Bug 1126607, part 2: Integrate the imported code into moz.build, r=glandium.


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