|
|
|
|
@@ -88,10 +88,10 @@ void main() {
|
|
|
|
|
|
|
|
|
|
expect(localizations.formatHour(const TimeOfDay(hour: 10, minute: 0)), isNotNull);
|
|
|
|
|
expect(localizations.formatMinute(const TimeOfDay(hour: 10, minute: 0)), isNotNull);
|
|
|
|
|
expect(localizations.formatYear(DateTime(2018, 8)), isNotNull);
|
|
|
|
|
expect(localizations.formatMediumDate(DateTime(2018, 8)), isNotNull);
|
|
|
|
|
expect(localizations.formatFullDate(DateTime(2018, 8)), isNotNull);
|
|
|
|
|
expect(localizations.formatMonthYear(DateTime(2018, 8)), isNotNull);
|
|
|
|
|
expect(localizations.formatYear(DateTime(2018, 8, 1)), isNotNull);
|
|
|
|
|
expect(localizations.formatMediumDate(DateTime(2018, 8, 1)), isNotNull);
|
|
|
|
|
expect(localizations.formatFullDate(DateTime(2018, 8, 1)), isNotNull);
|
|
|
|
|
expect(localizations.formatMonthYear(DateTime(2018, 8, 1)), isNotNull);
|
|
|
|
|
expect(localizations.narrowWeekdays, isNotNull);
|
|
|
|
|
expect(localizations.narrowWeekdays.length, 7);
|
|
|
|
|
expect(localizations.formatDecimal(123), isNotNull);
|
|
|
|
|
@@ -100,14 +100,14 @@ void main() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
testWidgets('translations spot check', (WidgetTester tester) async {
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh');
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
expect(localizations.firstPageTooltip, '第一页');
|
|
|
|
|
expect(localizations.lastPageTooltip, '最后一页');
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zu');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zu', scriptCode: null, countryCode: null);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
expect(localizations.firstPageTooltip, 'Ikhasi lokuqala');
|
|
|
|
|
@@ -181,7 +181,7 @@ void main() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
testWidgets('Chinese resolution', (WidgetTester tester) async {
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh');
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
@@ -191,22 +191,22 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHantTw>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'HK');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'HK');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHantHk>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'TW');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'TW');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHantTw>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHans>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHant>());
|
|
|
|
|
@@ -236,7 +236,7 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHant>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'US');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'US');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
@@ -251,7 +251,7 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'TW');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'TW');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
@@ -261,34 +261,34 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', countryCode: 'RU');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: 'RU');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Cyrl', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
testWidgets('Serbian resolution', (WidgetTester tester) async {
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'sr');
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSr>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Cyrl', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSrCyrl>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: 'Latn', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSrLatn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'SR');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: 'SR');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSr>());
|
|
|
|
|
@@ -313,49 +313,49 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSrLatn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', countryCode: 'US');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: 'US');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationSr>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
testWidgets('Misc resolution', (WidgetTester tester) async {
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'en');
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Cyrl');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Cyrl', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'US');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'US');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'AU');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'AU');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEnAu>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'GB');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'GB');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEnGb>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'SG');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'SG');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEnSg>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', countryCode: 'MX');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: null, countryCode: 'MX');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'en', scriptCode: 'Hant', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
@@ -370,37 +370,37 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEn>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEs>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', countryCode: '419');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: '419');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEs419>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'MX');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'MX');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEsMx>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'US');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'US');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEsUs>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'AR');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'AR');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEsAr>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', countryCode: 'ES');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: null, countryCode: 'ES');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEs>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'es', scriptCode: 'Latn', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEs>());
|
|
|
|
|
@@ -410,39 +410,39 @@ void main() {
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationEsUs>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'fr');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'fr', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationFr>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'fr', countryCode: 'CA');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'fr', scriptCode: null, countryCode: 'CA');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationFrCa>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'de');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'de', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationDe>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'de', countryCode: 'CH');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'de', scriptCode: null, countryCode: 'CH');
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationDeCh>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'th');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'th', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationTh>());
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'ru');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'ru', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationRu>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
testWidgets('Chinese translations spot check', (WidgetTester tester) async {
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh');
|
|
|
|
|
Locale locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: null, countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZh>());
|
|
|
|
|
@@ -451,7 +451,7 @@ void main() {
|
|
|
|
|
expect(localizations.closeButtonLabel, '关闭');
|
|
|
|
|
expect(localizations.okButtonLabel, '确定');
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hans', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHans>());
|
|
|
|
|
@@ -460,7 +460,7 @@ void main() {
|
|
|
|
|
expect(localizations.closeButtonLabel, '关闭');
|
|
|
|
|
expect(localizations.okButtonLabel, '确定');
|
|
|
|
|
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant');
|
|
|
|
|
locale = const Locale.fromSubtags(languageCode: 'zh', scriptCode: 'Hant', countryCode: null);
|
|
|
|
|
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
|
|
|
|
localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
|
|
|
|
expect(localizations, isA<MaterialLocalizationZhHant>());
|
|
|
|
|
|