Skip to content

Conversation

thkim1011
Copy link
Contributor

@thkim1011 thkim1011 commented Jun 26, 2023

Based on the message format syntax for ICU4J. This adds new syntax to the current Flutter messageFormat parser which should allow developers to add locale-specific date formatting.

Usage example

  "datetimeTest": "Today is {today, date, ::yMd}",
  "@datetimeTest": {
    "placeholders": {
      "today": {
        "description": "The date placeholder",
        "type": "DateTime"
      }
    }
  }

compiles to

  String datetimeTest(DateTime today) {
    String _temp0 = intl.DateFormat.yMd(localeName).format(today);
    return 'Today is $_temp0';
  }

Fixes #127304.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 26, 2023
@thkim1011 thkim1011 changed the title Add DateTime formatting syntax Add locale-specific DateTime formatting syntax Jun 26, 2023
@thkim1011 thkim1011 requested a review from HansMuller June 28, 2023 15:35
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE. LGTM

There's a test failure but it doesn't seem to be related to this PR. Probably best to sync and push (run the presubmits again).

@github-actions github-actions bot removed the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 28, 2023
@thkim1011 thkim1011 merged commit ff838bc into flutter:master Jun 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 29, 2023
camsim99 added a commit to flutter/packages that referenced this pull request Jun 30, 2023
flutter/flutter@51bef1b...ff838bc

2023-06-29 thkim1011@users.noreply.github.com Add locale-specific
DateTime formatting syntax (flutter/flutter#129573)
2023-06-29 tessertaha@gmail.com Update `RadioListTile` tests to M3
(flutter/flutter#129718)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
7fd0e9522ea1 to eabb22900b44 (1 revision) (flutter/flutter#129754)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
d5c25ead07e9 to 7fd0e9522ea1 (2 revisions) (flutter/flutter#129752)
2023-06-29 tjtanjia.tan@gmail.com Fix typos in ListTile examples.
(flutter/flutter#129606)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4e49b9deb72d to d5c25ead07e9 (7 revisions) (flutter/flutter#129750)
2023-06-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from
241ca5c1d6be to 4e49b9deb72d (1 revision) (flutter/flutter#129730)
2023-06-29 jacksongardner@google.com Skwasm benchmarks.
(flutter/flutter#129681)
2023-06-28 jmccandless@google.com RTL InputDecoration fix
(flutter/flutter#129661)
2023-06-28 christopherfujino@gmail.com mark autoroller flaky
(flutter/flutter#129745)
2023-06-28 fluttergithubbot@gmail.com Roll pub packages
(flutter/flutter#129380)
2023-06-28 109253501+pdblasi-google@users.noreply.github.com Removes
deprecated APIs from AnimationBuilder (flutter/flutter#129657)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC
camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on
the revert to ensure that a human
is aware of the problem.

To file a bug in Packages:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

---------

Co-authored-by: Camille Simon <43054281+camsim99@users.noreply.github.com>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Localizations not generated correctly
2 participants