| Index: pkg/intl/lib/number_format.dart
|
| ===================================================================
|
| --- pkg/intl/lib/number_format.dart (revision 13446)
|
| +++ pkg/intl/lib/number_format.dart (working copy)
|
| @@ -52,7 +52,7 @@
|
| * [locale].
|
| */
|
| NumberFormat([String newPattern, String locale]):
|
| - _locale = Intl.verifiedLocale(locale) {
|
| + _locale = Intl.verifiedLocale(locale, localeExists) {
|
| // TODO(alanknight): There will need to be some kind of async setup
|
| // operations so as not to bring along every locale in every program.
|
| _symbols = numberFormatSymbols[_locale];
|
| @@ -65,6 +65,15 @@
|
| String get locale => _locale;
|
|
|
| /**
|
| + * Return true if the locale exists, or if it is null. The null case
|
| + * is interpreted to mean that we use the default locale.
|
| + */
|
| + static bool localeExists(localeName) {
|
| + if (localeName == null) return false;
|
| + return numberFormatSymbols.containsKey(localeName);
|
| + }
|
| +
|
| + /**
|
| * Return the symbols which are used in our locale. Cache them to avoid
|
| * repeated lookup.
|
| */
|
|
|