diff babel/core.py @ 592:e6b1efa9a255 trunk

fix Locale.default to return Locales with correct territory information
author fschwarz
date Thu, 09 Aug 2012 07:47:09 +0000
parents d1618dfaf114
children
line wrap: on
line diff
--- a/babel/core.py
+++ b/babel/core.py
@@ -144,7 +144,7 @@
         ...     os.environ[name] = ''
         >>> os.environ['LANG'] = 'fr_FR.UTF-8'
         >>> Locale.default('LC_MESSAGES')
-        Locale('fr_FR')
+        Locale('fr', territory='FR')
 
         :param category: one of the ``LC_XXX`` environment variable names
         :param aliases: a dictionary of aliases for locale identifiers
@@ -153,7 +153,8 @@
         :rtype: `Locale`
         :see: `default_locale`
         """
-        return cls(default_locale(category, aliases=aliases))
+        locale_string = default_locale(category, aliases=aliases)
+        return cls.parse(locale_string)
 
     @classmethod
     def negotiate(cls, preferred, available, sep='_', aliases=LOCALE_ALIASES):
Copyright (C) 2012-2017 Edgewall Software