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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user