From: Armin Ronacher Date: Fri, 5 Jul 2013 18:55:38 +0000 (+0200) Subject: Don't expose plural names for currencies on the locale object X-Git-Tag: 1.0~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bcb3ec7dfb90acb5552d049f5be8d49e76ebce1;p=thirdparty%2Fbabel.git Don't expose plural names for currencies on the locale object --- diff --git a/babel/core.py b/babel/core.py index f20197be..a72684dd 100644 --- a/babel/core.py +++ b/babel/core.py @@ -412,20 +412,6 @@ class Locale(object): :type: `dict`""" return self._data['currency_names'] - @property - def currencies_with_pluralization(self): - """Mapping of currency codes to translated currency names. The - value for each currency is a dictionary with the pluralization - strings. - - >>> Locale('de', 'DE').currencies_with_pluralization['COP']['one'] - u'Kolumbianischer Peso' - >>> Locale('de', 'DE').currencies_with_pluralization['COP']['other'] - u'Kolumbianische Pesos' - - :type: `dict`""" - return self._data['currency_names_plural'] - @property def currency_symbols(self): """Mapping of currency codes to symbols. diff --git a/babel/numbers.py b/babel/numbers.py index f3e76a4c..cecba347 100644 --- a/babel/numbers.py +++ b/babel/numbers.py @@ -53,7 +53,7 @@ def get_currency_name(currency, count=None, locale=LC_NUMERIC): loc = Locale.parse(locale) if count is not None: plural_form = loc.plural_form(count) - plural_names = loc.currencies_with_pluralization + plural_names = loc._data['currency_names_plural'] if currency in plural_names: return plural_names[currency][plural_form] return loc.currencies.get(currency, currency)