-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
Description
When using placeholder for DateTimes with custom formatting, flutter always uses the custom format from english.
Steps to Reproduce
- Setup Localization as per official docs
- Fill localization with custom date formats:
// app_en.arb
{
"date": "{date}",
"@date": {
"placeholders": {
"date": {
"type": "DateTime",
"format": "MM/dd/yyyy",
"isCustomDateFormat": "true"
}
}
}
}
// app_de.arb
{
"date": "{date}",
"@date": {
"placeholders": {
"date": {
"type": "DateTime",
"format": "dd.MM.yyyy",
"isCustomDateFormat": "true"
}
}
}
}
- run
flutter gen-l10n - Look into the generated code for de_locale: .dart_tool/flutter_gen/gen_l10n/app_localization_de.dart
Expected results:
I expect the generated format to be dd.MM.yyyy
String date(DateTime date) {
final intl.DateFormat dateDateFormat = intl.DateFormat('dd.MM.yyyy', localeName);
final String dateString = dateDateFormat.format(date);
return '$dateString';
}
Actual results:
But the generated format is MM/dd/yyyy
String date(DateTime date) {
final intl.DateFormat dateDateFormat = intl.DateFormat('MM/dd/yyyy', localeName);
final String dateString = dateDateFormat.format(date);
return '$dateString';
}
rmanguinho, tenhobi, lukepighetti and orestesgaolin
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team