From 25f2df623d7f66eaf9075aa78c283dabad289bb7 Mon Sep 17 00:00:00 2001 From: Jay Date: Fri, 28 Feb 2025 04:36:21 +0900 Subject: [PATCH] Fix korean cupertino datepicker datetime order (#163850) Currently, in the Korean locale (`ko`), the `CupertinoDatePicker` displays the time in the order of `hour : minute : AM/PM`. However, the correct format for Korean conventions is `AM/PM : hour : minute`. This PR modifies the `CupertinoDatePicker` to display the time in the correct order when the Korean locale is used. ## Changes - Updated the time display order for the Korean (`ko`) locale in `CupertinoDatePicker`. - Previous format: `hour : minute : AM/PM` - Updated format: `AM/PM : hour : minute` ## 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]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --- AUTHORS | 1 + .../lib/src/l10n/cupertino_ko.arb | 2 +- .../l10n/generated_cupertino_localizations.dart | 2 +- .../test/cupertino/translations_test.dart | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 69cb72a857..4b355cb810 100644 --- a/AUTHORS +++ b/AUTHORS @@ -132,3 +132,4 @@ dy0gu Albert Wolszon Mohammed Chahboun Abdessalem Mohellebi +Jin Jeongsu \ No newline at end of file diff --git a/packages/flutter_localizations/lib/src/l10n/cupertino_ko.arb b/packages/flutter_localizations/lib/src/l10n/cupertino_ko.arb index 204f81be3c..7fafd09bca 100644 --- a/packages/flutter_localizations/lib/src/l10n/cupertino_ko.arb +++ b/packages/flutter_localizations/lib/src/l10n/cupertino_ko.arb @@ -4,7 +4,7 @@ "datePickerMinuteSemanticsLabelOne": "1분", "datePickerMinuteSemanticsLabelOther": "$minute분", "datePickerDateOrder": "ymd", - "datePickerDateTimeOrder": "date_time_dayPeriod", + "datePickerDateTimeOrder": "date_dayPeriod_time", "anteMeridiemAbbreviation": "오전", "postMeridiemAbbreviation": "오후", "todayLabel": "오늘", diff --git a/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart b/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart index 3cfe2316c9..bb8aa5f07c 100644 --- a/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart +++ b/packages/flutter_localizations/lib/src/l10n/generated_cupertino_localizations.dart @@ -8182,7 +8182,7 @@ class CupertinoLocalizationKo extends GlobalCupertinoLocalizations { String get datePickerDateOrderString => 'ymd'; @override - String get datePickerDateTimeOrderString => 'date_time_dayPeriod'; + String get datePickerDateTimeOrderString => 'date_dayPeriod_time'; @override String? get datePickerHourSemanticsLabelFew => null; diff --git a/packages/flutter_localizations/test/cupertino/translations_test.dart b/packages/flutter_localizations/test/cupertino/translations_test.dart index f8d1998d3d..4db59631a3 100644 --- a/packages/flutter_localizations/test/cupertino/translations_test.dart +++ b/packages/flutter_localizations/test/cupertino/translations_test.dart @@ -287,6 +287,20 @@ void main() { expect(localizations.datePickerDayOfMonth(1), '1日'); expect(localizations.datePickerDayOfMonth(1, 2), '周二 1日'); }); + + testWidgets('Test correct time order for CupertinoDatePicker in Korean locale', ( + WidgetTester tester, + ) async { + const Locale locale = Locale('ko'); + expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue); + + final CupertinoLocalizations localizations = await GlobalCupertinoLocalizations.delegate.load( + locale, + ); + + expect(localizations, isA()); + expect(localizations.datePickerDateTimeOrder, DatePickerDateTimeOrder.date_dayPeriod_time); + }); } class _FakeEditableText extends EditableText {