Remove stripping scriptCodes for localization. (#83903)

This commit is contained in:
greymag
2021-06-16 23:39:05 +03:00
committed by GitHub
parent 430bfac41c
commit f8d73be84c
2 changed files with 17 additions and 20 deletions

View File

@@ -158,6 +158,23 @@ void main() {
expect(formatted[DateType.full], 'Mittwoch, 1. August 2018');
expect(formatted[DateType.monthYear], 'August 2018');
});
testWidgets('formats dates in Serbian', (WidgetTester tester) async {
final Map<DateType, String> formatted = await formatDate(tester, const Locale('sr'), DateTime(2018, 8, 1));
expect(formatted[DateType.year], '2018.');
expect(formatted[DateType.medium], 'сре 1. авг');
expect(formatted[DateType.full], 'среда, 1. август 2018.');
expect(formatted[DateType.monthYear], 'август 2018.');
});
testWidgets('formats dates in Serbian (Latin)', (WidgetTester tester) async {
final Map<DateType, String> formatted = await formatDate(tester,
const Locale.fromSubtags(languageCode:'sr', scriptCode: 'Latn'), DateTime(2018, 8, 1));
expect(formatted[DateType.year], '2018.');
expect(formatted[DateType.medium], 'sre 1. avg');
expect(formatted[DateType.full], 'sreda, 1. avgust 2018.');
expect(formatted[DateType.monthYear], 'avgust 2018.');
});
});
});