Canonicalize locale string in gen_l10n.dart (#44758)

* Canonicalize locale string for gen_l10n.dart script

* Refresh stocks example to use canonicalized locale
This commit is contained in:
Shi-Hao Hong 2019-11-13 10:15:24 -08:00 committed by GitHub
parent 0d348138aa
commit a872a701c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ import 'messages_all.dart';
/// be consistent with the languages listed in the @className.supportedLocales
/// property.
class @className {
@className(Locale locale) : _localeName = locale.toString();
@className(Locale locale) : _localeName = Intl.canonicalizedLocale(locale.toString());
final String _localeName;

View File

@ -59,7 +59,7 @@ import 'messages_all.dart';
/// be consistent with the languages listed in the StockStrings.supportedLocales
/// property.
class StockStrings {
StockStrings(Locale locale) : _localeName = locale.toString();
StockStrings(Locale locale) : _localeName = Intl.canonicalizedLocale(locale.toString());
final String _localeName;