Edgewall Software
Please note:

The documentation here is generated live, in a way that is neither comprehensive nor 100% correct. We strongly recommend using the HTML documentation included with the source tarballs instead.


Low-level locale data access.

note:The Locale class, which uses this module under the hood, provides a more convenient interface for accessing the locale data.


Check whether locale data is available for the given locale.

param name:the locale identifier string
return:True if the locale data exists, False otherwise


Return a list of all locale identifiers for which locale data is available.

return:a list of locale identifiers (strings)
since:version 0.8.1


Load the locale data for the given locale.

The locale data is a dictionary that contains much of the data defined by the Common Locale Data Repository (CLDR). This data is stored as a collection of pickle files inside the babel package.

>>> d = load('en_US')
>>> d['languages']['sv']

Note that the results are cached, and subsequent requests for the same locale return the same dictionary:

>>> d1 = load('en_US')
>>> d2 = load('en_US')
>>> d1 is d2
param name:the locale identifier string (or "root")
return:the locale data
raise IOError:if no locale data file is found for the given locale identifer, or one of the locales it inherits from

merge(dict1, dict2)

Merge the data from dict2 into the dict1 dictionary, making copies of nested dictionaries.

param dict1:the dictionary to merge into
param dict2:the dictionary containing the data that should be merged

See ApiDocs/0.8, Documentation

Last modified 18 months ago Last modified on Dec 10, 2015 6:25:47 AM