Repository navigation
[gen-l10n] Invalid dart file is generated by gen-l10n when (there are no "regular" characters in front of a dollar sign) and (there is a select clause in a message) #125461
Copy link
Copy link
Closed
Labels
a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)found in release: 3.10Found to occur in 3.10Found to occur in 3.10found 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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Activity
- added a commit that references this issue
on Apr 25, 2023 - addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 25, 2023 - added a commit that references this issue
on Apr 25, 2023 Thanks for your report @mshurkaeu-public! This issue is reproducible on the latest
stableandmasterchannels.As you mentioned in the sample code (the 3rd string), adding
\u200Bin front of the dollar sign ($nice_bug) can work around this.flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.7.12 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4d9e56e694 (2 days ago), 2023-04-17 21:47:46 -0400 • Engine revision 1a65d409c7 • Dart version 2.19.6 • DevTools version 2.20.1 [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 32.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.77.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.62.0 [✓] Connected device (3 available) • SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.137 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found![!] Flutter (Channel master, 3.10.0-12.0.pre.47, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.10.0-12.0.pre.47 on channel master at /Users/huynq/Documents/GitHub/flutter_master ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path. • Upstream repository https://github.com/flutter/flutter.git • Framework revision d23dba223c (35 minutes ago), 2023-04-25 00:12:18 -0400 • Engine revision 8fe8e94c02 • Dart version 3.1.0 (build 3.1.0-38.0.dev) • DevTools version 2.23.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 32.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Applications/Android Studio Flamingo.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E222b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [✓] Android Studio (version 2022.2) • Android Studio at /Applications/Android Studio Flamingo.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.77.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.62.0 [✓] Connected device (3 available) • SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.137 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 1 category.
- addedtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.10Found to occur in 3.10Found to occur in 3.10and removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Apr 25, 2023 @thkim1011 can you take a look at this one? Also, what priority do you think this is?
- added a commit that references this issue
on Apr 25, 2023 - addedr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
on Apr 26, 2023 This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked as resolved and limited conversation to collaborators
on May 10, 2023
Metadata
Metadata
Assignees
Labels
a: internationalizationSupporting other languages or locales. (aka i18n)Supporting other languages or locales. (aka i18n)found in release: 3.10Found to occur in 3.10Found to occur in 3.10found 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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Is there an existing issue for this?
Steps to reproduce
Expected results
The generated app_localizations_en.dart file contains correctly escaped dollar sign:
Actual results
The generated app_localizations_en.dart file is invalid:
Code sample
Full code of the example is available in repository https://github.com/mshurkaeu-public/flutter-bugs-I-found-or-reported.git. Branch main. Folder 03-gen-l10n-dollar-sign+select-clause.
{ "helloBugManifistation1": "$nice_bug\nHello Bug! Manifistation #1 {selectPlaceholder, select, case{message} other{messageOther}}", "@helloBugManifistation1": { "description": "This is a demo #1 of the bug", "placeholders": { "selectPlaceholder": { "type": "String" } } }, "helloBugManifistation2": "{selectPlaceholder, select, case{} other{}}$nice_bug\nHello Bug! Manifistation #2 {selectPlaceholder, select, case{message} other{messageOther}}", "@helloBugManifistation2": { "description": "This is a demo #2 of the bug", "placeholders": { "selectPlaceholder": { "type": "String" } } }, "workaroundTheBug": "\u200B$nice_bug\nHello Bug! A workaround... {selectPlaceholder, select, case{message} other{messageOther}}", "@helloBug1": { "description": "This is a demo of a workaround for the bug", "placeholders": { "selectPlaceholder": { "type": "String" } } } }Screenshots or Video
No response
Logs
Logs
Flutter Doctor output
Doctor output