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.
This commit is contained in:
Jay 2025-02-28 04:36:21 +09:00 committed by GitHub
parent 2bc40b39dc
commit 25f2df623d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 17 additions and 2 deletions

View File

@ -132,3 +132,4 @@ dy0gu <support@dy0gu.com>
Albert Wolszon <albert@wolszon.me>
Mohammed Chahboun <m97.chahboun@gmail.com>
Abdessalem Mohellebi <mohellebiabdessalem@gmail.com>
Jin Jeongsu <jinjs.dev@gmail.com>

View File

@ -4,7 +4,7 @@
"datePickerMinuteSemanticsLabelOne": "1분",
"datePickerMinuteSemanticsLabelOther": "$minute분",
"datePickerDateOrder": "ymd",
"datePickerDateTimeOrder": "date_time_dayPeriod",
"datePickerDateTimeOrder": "date_dayPeriod_time",
"anteMeridiemAbbreviation": "오전",
"postMeridiemAbbreviation": "오후",
"todayLabel": "오늘",

View File

@ -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;

View File

@ -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<CupertinoLocalizationKo>());
expect(localizations.datePickerDateTimeOrder, DatePickerDateTimeOrder.date_dayPeriod_time);
});
}
class _FakeEditableText extends EditableText {