mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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:
parent
0d348138aa
commit
a872a701c3
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user