]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
ignore `uncommon` parameter
authorAlex Morega <alex@grep.ro>
Thu, 4 Jul 2013 17:22:31 +0000 (19:22 +0200)
committerAlex Morega <alex@grep.ro>
Thu, 4 Jul 2013 17:45:54 +0000 (19:45 +0200)
The CLDR removed commonlyUsed information about timezone aliases:
http://www.unicode.org/reports/tr35/tr35-29.html#Timezone_Names
(search for "commonlyUsed")

babel/dates.py
scripts/import_cldr.py

index 9c008bc903bbffd3857c675d26b70a4951fa6360..856ea95fe1018017f1b0b726a7afc5e6d2d41c7e 100644 (file)
@@ -339,25 +339,13 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False,
     >>> get_timezone_name(tz, locale='de_DE')
     u"Kanada (St. John's)"
     
-    The `uncommon` parameter can be set to `True` to enable the use of timezone
-    representations that are not commonly used by the requested locale. For
-    example, while in French the central European timezone is usually
-    abbreviated as "HEC", in Canadian French, this abbreviation is not in
-    common use, so a generic name would be chosen by default:
-    
-    >>> tz = timezone('Europe/Paris')
-    >>> get_timezone_name(tz, 'short', locale='fr_CA')
-    u'France'
-    >>> get_timezone_name(tz, 'short', uncommon=True, locale='fr_CA')
-    u'HEC'
-    
     :param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
                          the timezone; if a ``tzinfo`` object is used, the
                          resulting display name will be generic, i.e.
                          independent of daylight savings time; if `None`, the
                          current date in UTC is assumed
     :param width: either "long" or "short"
-    :param uncommon: whether even uncommon timezone abbreviations should be used
+    :param uncommon: deprecated and ignored
     :param locale: the `Locale` object, or a locale string
     :return: the timezone display name
     :rtype: `unicode`
@@ -406,7 +394,7 @@ def get_timezone_name(dt_or_tzinfo=None, width='long', uncommon=False,
     metazone = get_global('meta_zones').get(zone)
     if metazone:
         metazone_info = locale.meta_zones.get(metazone, {})
-        if width in metazone_info and (uncommon or metazone_info.get('common')):
+        if width in metazone_info:
             if dt is None:
                 field = 'generic'
             else:
index 67f82652a79376892f489a58e83feb8935e4599a..acf181b1629e3424cea33117cb5209e11a8e831c 100755 (executable)
@@ -318,7 +318,6 @@ def main():
                 info.setdefault('long', {})[child.tag] = unicode(child.text)
             for child in elem.findall('short/*'):
                 info.setdefault('short', {})[child.tag] = unicode(child.text)
-            info['common'] = elem.findtext('commonlyUsed') == 'true'
             meta_zones[elem.attrib['type']] = info
 
         for calendar in tree.findall('.//calendars/calendar'):