1
2
3 """
4 pdt_locales
5
6 All of the included locale classes shipped with pdt.
7 """
8
9 from __future__ import absolute_import
10 from .icu import get_icu
11
12 locales = ['de_DE', 'en_AU', 'en_US', 'es', 'nl_NL', 'pt_BR', 'ru_RU', 'fr_FR']
13
14 __locale_caches = {}
15
16 __all__ = ['get_icu', 'load_locale']
17
18
20 """
21 Return data of locale
22 :param locale:
23 :return:
24 """
25 if locale not in locales:
26 raise NotImplementedError("The locale '%s' is not supported" % locale)
27 if locale not in __locale_caches:
28 mod = __import__(__name__, fromlist=[locale], level=0)
29 __locale_caches[locale] = getattr(mod, locale)
30 return __locale_caches[locale]
31