From fd12e3b2186e47653b25efccec28cee68bd20f7e Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Thu, 13 Jan 2011 03:02:32 +0000 Subject: Fixed #15024 -- Ensure that choice of L10N format module used is stable given a stable setup of format modules in ll/ and ll_CC/ dirs. Thanks David Reynolds for the report and suggestions leading to the solution. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15183 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/formats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'django/utils') diff --git a/django/utils/formats.py b/django/utils/formats.py index c23a37cb2b..1eb7a3d837 100644 --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -24,7 +24,9 @@ def iter_format_modules(lang): format_locations.append(settings.FORMAT_MODULE_PATH + '.%s') format_locations.reverse() locale = to_locale(lang) - locales = set((locale, locale.split('_')[0])) + locales = [locale] + if '_' in locale: + locales.append(locale.split('_')[0]) for location in format_locations: for loc in locales: try: -- cgit v1.3