Skip to content

Commit 25f2df6

Browse files
authored
Fix korean cupertino datepicker datetime order (flutter#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.
1 parent 2bc40b3 commit 25f2df6

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,4 @@ dy0gu <[email protected]>
132132
Albert Wolszon <[email protected]>
133133
Mohammed Chahboun <[email protected]>
134134
Abdessalem Mohellebi <[email protected]>
135+
Jin Jeongsu <[email protected]>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"datePickerMinuteSemanticsLabelOne": "1분",
55
"datePickerMinuteSemanticsLabelOther": "$minute분",
66
"datePickerDateOrder": "ymd",
7-
"datePickerDateTimeOrder": "date_time_dayPeriod",
7+
"datePickerDateTimeOrder": "date_dayPeriod_time",
88
"anteMeridiemAbbreviation": "오전",
99
"postMeridiemAbbreviation": "오후",
1010
"todayLabel": "오늘",

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8182,7 +8182,7 @@ class CupertinoLocalizationKo extends GlobalCupertinoLocalizations {
81828182
String get datePickerDateOrderString => 'ymd';
81838183

81848184
@override
8185-
String get datePickerDateTimeOrderString => 'date_time_dayPeriod';
8185+
String get datePickerDateTimeOrderString => 'date_dayPeriod_time';
81868186

81878187
@override
81888188
String? get datePickerHourSemanticsLabelFew => null;

packages/flutter_localizations/test/cupertino/translations_test.dart

+14
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,20 @@ void main() {
287287
expect(localizations.datePickerDayOfMonth(1), '1日');
288288
expect(localizations.datePickerDayOfMonth(1, 2), '周二 1日');
289289
});
290+
291+
testWidgets('Test correct time order for CupertinoDatePicker in Korean locale', (
292+
WidgetTester tester,
293+
) async {
294+
const Locale locale = Locale('ko');
295+
expect(GlobalCupertinoLocalizations.delegate.isSupported(locale), isTrue);
296+
297+
final CupertinoLocalizations localizations = await GlobalCupertinoLocalizations.delegate.load(
298+
locale,
299+
);
300+
301+
expect(localizations, isA<CupertinoLocalizationKo>());
302+
expect(localizations.datePickerDateTimeOrder, DatePickerDateTimeOrder.date_dayPeriod_time);
303+
});
290304
}
291305

292306
class _FakeEditableText extends EditableText {

0 commit comments

Comments
 (0)