calendar/locales/filter.py
author Mark Banner <standard8@mozilla.com>
Mon, 28 Apr 2014 20:30:10 +0100
changeset 19701 ebcaac24ae6e0ba51d0e5da49bf823ca0b3822f1
parent 15798 8e475124e59f2d281ac2dad916315fcb2e4c9436
child 19752 53d94b6aec5e6d5f6dcc6dc573bcbdc6ae8c7640
permissions -rw-r--r--
Added tag BETA_BASE_20140428 for changeset ffacfc0539ea a=betamerge DONTBUILD CLOSED TREE


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

  # ignore anyhting but calendar stuff
  if mod not in ("netwerk", "dom", "toolkit", "security/manager",
                 "calendar", "other-licenses/branding/sunbird"):
    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"

  # Sunbird specific strings don't need translation
  if path.startswith("chrome/sunbird/"):
    return False

  # Everything else should be taken into account
  return True