Skip to content

Commit e78f135

Browse files
authored
Fix issue #156954: Wrong dateHelpText in MaterialLocalizationIt (#161889)
Fix #156954 - Changed current value `dataHelpText` used in `MaterialLocalizationIt` from "mm/gg/aaaa" to "gg/mm/aaaa" - Wrote test <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 996badc commit e78f135

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

packages/flutter_localizations/lib/src/l10n/generated_material_localizations.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21688,7 +21688,7 @@ class MaterialLocalizationIt extends GlobalMaterialLocalizations {
2168821688
String get cutButtonLabel => 'Taglia';
2168921689

2169021690
@override
21691-
String get dateHelpText => 'mm/gg/aaaa';
21691+
String get dateHelpText => 'gg/mm/aaaa';
2169221692

2169321693
@override
2169421694
String get dateInputLabel => 'Inserisci data';

packages/flutter_localizations/lib/src/l10n/material_it.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"refreshIndicatorSemanticLabel": "Aggiorna",
5757
"moreButtonTooltip": "Altro",
5858
"dateSeparator": "/",
59-
"dateHelpText": "mm/gg/aaaa",
59+
"dateHelpText": "gg/mm/aaaa",
6060
"selectYearSemanticsLabel": "Seleziona anno",
6161
"unspecifiedDate": "Data",
6262
"unspecifiedDateRange": "Intervallo di date",

packages/flutter_localizations/test/material/translations_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,4 +596,15 @@ void main() {
596596
expect(localizations.copyButtonLabel, '복사');
597597
expect(localizations.pasteButtonLabel, '붙여넣기');
598598
});
599+
600+
// Regression test for https://github.com/flutter/flutter/issues/156954
601+
testWidgets('Italian translation for dateHelpText', (WidgetTester tester) async {
602+
const Locale locale = Locale('it');
603+
expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue);
604+
final MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(
605+
locale,
606+
);
607+
expect(localizations, isA<MaterialLocalizationIt>());
608+
expect(localizations.dateHelpText, 'gg/mm/aaaa');
609+
});
599610
}

0 commit comments

Comments
 (0)