Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error when plural case had undefined behavior #116622

Merged
merged 3 commits into from
Dec 8, 2022

Conversation

thkim1011
Copy link
Contributor

@thkim1011 thkim1011 commented Dec 6, 2022

The ICU syntax for plural only handles cases for

  • =0 or zero
  • =1 or one
  • =2 or two
  • many
  • few
  • other.

When anything else is specified the behavior is undefined and we should throw a concrete error to warn the user.

Fixes #116459.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 6, 2022
final String? transformedPluralCase = pluralCases[pluralCase];
if (transformedPluralCase == null) {
throw L10nParserException(
'The plural case $pluralCase is not a valid plural case.',
Copy link
Member

Choose a reason for hiding this comment

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

Shall we either document here or link to some documentation as to what the valid plural cases are?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant something that the user sees, so that this error is actionable.

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@thkim1011 thkim1011 added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 8, 2022
@auto-submit auto-submit bot merged commit 117a83a into flutter:master Dec 8, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Dec 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 11, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 15, 2022
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 15, 2022
* 003608f18 Update text field input width when there are prefix/suffix icons (flutter/flutter#116690)

* bebea0cc6 [Windows] Add a `flutter run` console output test (flutter/flutter#116626)

* 117a83a4a Throw error when plural case had undefined behavior (flutter/flutter#116622)

* afdc48401 add test of flutter update-packages --transitive-closure --consumer-only (flutter/flutter#116747)

* 7c8e17132 Manual Roll of Flutter Engine from 67254d6e4b03 to 8d83b98c55b3 (flutter/flutter#116635)

* eefbe85c8 Bump dartdoc to 6.1.4 (flutter/flutter#116758)

* 48cfe2eb0 Opt dashing_postprocess.dart out of null safety until we figure out why (flutter/flutter#116786)

* b4304dadc Update the Dart language version in the pubspec generated by the dartdoc script (flutter/flutter#116789)

* 55e750115 Roll Plugins from 51434ec to 6ab7d71 (3 revisions) (flutter/flutter#116781)

* e57b7f4ea Add Material 3 support for `ListTile` - Part 1 (flutter/flutter#116194)

* 73cb7c2fc Squashed MediaQuery InheritedModel (flutter/flutter#114459)

* 1da8f4edc Several fixes to packaging builders. (flutter/flutter#116800)

* 86fa9e511 Roll Flutter Engine from 8d83b98c55b3 to 030950f3070c (29 revisions) (flutter/flutter#116802)

* ca3ce3945 89fd33c62 Don't use sync*, as it is unimplemented in dart2wasm. (flutter/engine#38149) (flutter/flutter#116808)

* 332032dda Roll Flutter Engine from 89fd33c62f2c to a259613ab871 (2 revisions) (flutter/flutter#116811)

* 9dd30878d Add LookupBoundary to Material (flutter/flutter#116736)

* cbdc763cf Roll Flutter Engine from a259613ab871 to 8b56b5a98ed4 (2 revisions) (flutter/flutter#116813)

* c4b8046d9 Floating cursor cleanup (flutter/flutter#116746)

* 7d7848aba d64a5129a [const_finder] Ignore constructor invocations from generated tear-off declarations (flutter/engine#38131) (flutter/flutter#116814)

* be5c389e6 faae28965 Roll Skia from 44062eff3e25 to 1b194c67700e (2 revisions) (flutter/engine#38166) (flutter/flutter#116817)

* 7549925c8 Revert "Adds API in semanticsconfiguration to decide how to merge child semanticsConfigurations (#110730)" (flutter/flutter#116839)

* 68f02dd2e Roll Flutter Engine from faae28965a94 to fbb79e704b0a (6 revisions) (flutter/flutter#116843)

* ec02f3bfb 656b67796 Roll Dart SDK from 0940b5e6ccd5 to 21f2997a8fc6 (9 revisions) (flutter/engine#38172) (flutter/flutter#116844)

* c02d53fc0 More gracefully handle license loading failures (flutter/flutter#87841)

* 4a1511166 0795bccae Roll Skia from 0d482f9fa8b3 to 80d9e679f909 (2 revisions) (flutter/engine#38195) (flutter/flutter#116853)

* 1fc166a51 3ca497ebb Roll Skia from 80d9e679f909 to 29791c73ae16 (1 revision) (flutter/engine#38200) (flutter/flutter#116859)

* 9fdb64b7e Taboo the word "simply" from our API documentation. (flutter/flutter#116061)

* 92aebc953 922546c91 [Impeller] Fix asset names used for the generated entrypoint name can contain invalid identifiers for the target language (flutter/engine#38202) (flutter/flutter#116868)

* 437f6f86e 9e37c9883 Roll Skia from 29791c73ae16 to 7bd37737e35d (1 revision) (flutter/engine#38207) (flutter/flutter#116871)

* d19f77674 62a5de2ef Roll Skia from 7bd37737e35d to 0cb546781e89 (4 revisions) (flutter/engine#38213) (flutter/flutter#116880)

* bd0791be3 Pass drone_dimensions as part of the main target. (flutter/flutter#116812)

* d1436d1df Roll Plugins from 6ab7d71 to 0609adb (2 revisions) (flutter/flutter#116891)

* 84ed058b4 [flutter_tools] Add remap sampler support (flutter/flutter#116861)

* a8c9f9c6f Fix `NavigationBar` ripple for non-default `NavigationDestinationLabelBehavior` (flutter/flutter#116888)

* 5a229e282 Add LookupBoundary to Overlay (flutter/flutter#116741)

* d19047d8a [framework] make opacity widget create a repaint boundary (flutter/flutter#116788)

* 882e105a4 Revert "Add Material 3 support for `ListTile` - Part 1 (#116194)" (flutter/flutter#116908)

* 7a743c881 [flutter_tools] Pin and roll pub (flutter/flutter#116745)

* 558b7e004 Adjust test to tolerate additional trace fields (flutter/flutter#116914)

* c420562ef Fix output match (flutter/flutter#116912)

* 8e1f8352b Fix MediaQuery.paddingOf (flutter/flutter#116858)

* 8cfc6061e Roll Flutter Engine from 62a5de2efc9c to 2148fc003077 (5 revisions) (flutter/flutter#116920)

* 601f48cd9 InteractiveViewer discrete trackpad panning (flutter/flutter#112171)

* 41625b662 Test flutter run does not have unexpected engine logs (flutter/flutter#116798)

* 9b46f2a69 ff2fe8381 [cpp20] Fix incompatible aggregate initialization (flutter/engine#38165) (flutter/flutter#116927)

* 15939b477 Remove duped fix rules (flutter/flutter#116933)

* e331dcda1 [framework] make transform with filterQuality a rpb (flutter/flutter#116792)

* 6432fd1b1 6c190ea1e Roll Skia from bb9378b61c4f to 788fe69e7ade (6 revisions) (flutter/engine#38226) (flutter/flutter#116935)

* 97df2b319 Fix scroll jump when NestedScrollPosition is inertia-cancelled. (flutter/flutter#116689)

* ca7fe3348 Roll Flutter Engine from 6c190ea1e8df to e144f81e92d8 (3 revisions) (flutter/flutter#116939)

* b713edcee 290f3a35e Roll Skia from 788fe69e7ade to 2e417d4f7993 (3 revisions) (flutter/engine#38235) (flutter/flutter#116941)

* 04ee5926a Remove RenderEditable textPainter height hack (flutter/flutter#113301)

* 7211ca09d a33e699de Roll Skia from 2e417d4f7993 to 08dc0c9e4e70 (1 revision) (flutter/engine#38239) (flutter/flutter#116952)

* f5249bcb0 Remove use of NullThrownError (flutter/flutter#116122)

* 9ccfb87ad 64a661d6d Roll Skia from 08dc0c9e4e70 to 9abf4b1bf242 (4 revisions) (flutter/engine#38240) (flutter/flutter#116955)

* 256d54e17 47417ce80 [Impeller Scene] Node deserialization (flutter/engine#38190) (flutter/flutter#116959)

* db26f486e afc2f9559 Roll Skia from 9abf4b1bf242 to c83eef7dc2a3 (3 revisions) (flutter/engine#38243) (flutter/flutter#116970)

* 15af81782 74a9c7e0f Roll Fuchsia Mac SDK from aMW0DjntzFJj4RoR3... to Cd_ZtrDVcpQ85HRL3... (flutter/engine#38242) (flutter/flutter#116973)

* dbb9aa8b9 Roll Plugins from 0609adb to ec2041f (6 revisions) (flutter/flutter#116996)

* cd9a439c3 Roll Flutter Engine from 74a9c7e0f9b1 to 9872cc7addce (2 revisions) (flutter/flutter#116997)

* 4e1372080 dd1dc7258 Always set orientation preferences on iOS 16+ (flutter/engine#38230) (flutter/flutter#117005)

* 51945a0df Roll Flutter Engine from dd1dc7258b99 to 82dafdfc1c3d (2 revisions) (flutter/flutter#117015)

* 96597c25e Bump Dartdoc version to 6.1.5 (flutter/flutter#117014)

* 0c7d84aa7 Add AppBar.forceMaterialTransparency (#101248) (flutter/flutter#116867)

* a59dd83d7 a327b48ca Roll Skia from 280ac8882cff to 537e1e8c1ca6 (9 revisions) (flutter/engine#38264) (flutter/flutter#117025)

* fae458b92 Convert TimePicker to Material 3 (flutter/flutter#116396)

* ba917d615 Remove workaround because issue is closed (flutter/flutter#110854)

* 60635be59 984ec305a Run Mac Host clang-tidy on 12 cores (flutter/engine#38261) (flutter/flutter#117028)

* f0ea37646 Roll Flutter Engine from 984ec305a0dd to 14194c40ec00 (2 revisions) (flutter/flutter#117031)

* f07db4018 `NavigationBar` improvements (flutter/flutter#116992)

* 028c6e29e [Android] Fix the `run_debug_test_android` device lab test (flutter/flutter#117016)

* 8e452be2f Marks Windows run_release_test_windows to be unflaky (flutter/flutter#117071)

* 0e0f29fc8 Run packaging builders only on beta and stable. (flutter/flutter#117037)

* ef3fe6a05 10c0293 [local_auth]: Bump fragment from 1.5.4 to 1.5.5 in /packages/local_auth/local_auth_android/android (flutter/plugins#6826) (flutter/flutter#117078)

* 7a801f766 0baa4b5b3 Generate font fallback data to be const. (flutter/engine#38259) (flutter/flutter#117080)

* c63d797f9 Upgrade dependencies (flutter/flutter#117007)

* 57fb36ee0 [reland] Add Material 3 support for `ListTile` - Part 1 (flutter/flutter#116963)

* f9acb1e88 -- unnecessary parens (flutter/flutter#117081)

* aa0b68119 flutter/engine@0baa4b5...0a6a4a58 (flutter/flutter#117083)

* d8b7eb6e2 Updated token templates to sync with master code. (flutter/flutter#117097)

* 7b19b4d38 Fix CupertinoTextSelectionToolbar showing unnecessary pagination (flutter/flutter#104587)

* dbc930638 Failure to construct ErrorWidget for build errors does not destroy tree (flutter/flutter#117090)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
* init

* add comment

* make error more actionable
christopherfujino pushed a commit to christopherfujino/flutter that referenced this pull request Jan 28, 2023
* init

* add comment

* make error more actionable
XilaiZhang added a commit that referenced this pull request Feb 1, 2023
…19384)

* Throw error when plural case had undefined behavior (#116622)

* init

* add comment

* make error more actionable

* improve test

* increase debugging for find_commit.dart

---------

Co-authored-by: Tae Hyung Kim <thkim1011@users.noreply.github.com>
Co-authored-by: Xilai Zhang <xilaizhang@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
2 participants