]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Explicit normalize_locale() documentation.
authorKevin Deldycke <kdeldycke@scaleway.com>
Thu, 3 Mar 2016 17:09:05 +0000 (18:09 +0100)
committerKevin Deldycke <kdeldycke@scaleway.com>
Thu, 3 Mar 2016 17:09:05 +0000 (18:09 +0100)
babel/localedata.py

index a20a8813af876685653b07e52e0f31803ebf941a..265e4b8fd4fa929c554d2f53f69048e795392c10 100644 (file)
@@ -26,7 +26,11 @@ _dirname = os.path.join(os.path.dirname(__file__), 'locale-data')
 
 
 def normalize_locale(name):
-    """Return a normalized locale ID or `None` if the ID is not recognized."""
+    """Normalize a locale ID by stripping spaces and apply proper casing.
+
+    Returns the normalized locale ID string or `None` if the ID is not
+    recognized.
+    """
     name = name.strip().lower()
     for locale_id in chain.from_iterable([_cache, locale_identifiers()]):
         if name == locale_id.lower():