From: Kevin Deldycke Date: Thu, 3 Mar 2016 17:09:05 +0000 (+0100) Subject: Explicit normalize_locale() documentation. X-Git-Tag: 2.3.1~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5cb8317626b71d532f78c8d86c6b0e790ad4b7f;p=thirdparty%2Fbabel.git Explicit normalize_locale() documentation. --- diff --git a/babel/localedata.py b/babel/localedata.py index a20a8813..265e4b8f 100644 --- a/babel/localedata.py +++ b/babel/localedata.py @@ -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():