-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
[gen_l10n] A name that has any dollar sign ($) isn't allowed. #112250
Comments
In plain Dart the string
This is probably why it is disallowed. Either the warning message should be expanded to include a mention of |
I guess the reason mentioned, that the name must be a valid Dart method name. However, methods are allowed to start with class A {
void $asdf() {}
void f() {
var x = $asdf();
}
} I think this should be handled, or there is another reason of rejection. |
@asashour I forgot to mention, the format |
Yes, I want to use it to overload the placeholders functions because dart doesn't have function overloading feature. {
"foo$A": "foo {a}",
"@foo$A": {
"placeholders": {
"a": {
"type": "int",
}
}
},
"foo$B": "bar {a} {b}",
"@foo$B": {
"placeholders": {
"a": {
"type": "int",
},
"b": {
"type": "String",
}
}
}
} It's not only about prefix-$ but also includes a dollar sign in the middle. |
Thanks, but this applies to the values, not keys. What I recall, is that the key must be a valid method name, because a corresponding |
Hi @liplum, thanks for filing the issue. This issue is reproducible on the latest Logs
flutter doctor -v[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115 darwin-x64, locale en-VN)
• Flutter version 3.3.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (6 days ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13E113
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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.12+0-b1504.28-7817840)
[✓] 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.71.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
[✓] Flutter (Channel master, 3.4.0-28.0.pre.123, on macOS 12.6 21G115 darwin-x64, locale en-VN)
• Flutter version 3.4.0-28.0.pre.123 on channel master at /Users/huynq/Documents/GitHub/flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4aa27d844e (3 minutes ago), 2022-09-22 21:00:22 -0700
• Engine revision a5489ce4f9
• Dart version 2.19.0 (build 2.19.0-229.0.dev)
• DevTools version 2.17.0
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/huynq/Library/Android/sdk
• Platform android-33, build-tools 31.0.0
• ANDROID_HOME = /Users/huynq/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A309
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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.12+0-b1504.28-7817840)
[✓] 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.71.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0
[✓] Connected device (3 available)
• SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 12 (API 31)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.125
! Error: Failed to prepare the device for development. Please unlock and reconnect the device. (code 806)
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Labeling this issue for further insights from the team. Thanks! |
* [gen_l10n] keys can contain dollar sign Fixes #112250 * Update packages/flutter_tools/lib/src/localizations/gen_l10n.dart Co-authored-by: Christopher Fujino <fujino@google.com>
* [gen_l10n] keys can contain dollar sign Fixes flutter#112250 * Update packages/flutter_tools/lib/src/localizations/gen_l10n.dart Co-authored-by: Christopher Fujino <fujino@google.com>
* [gen_l10n] keys can contain dollar sign Fixes flutter#112250 * Update packages/flutter_tools/lib/src/localizations/gen_l10n.dart Co-authored-by: Christopher Fujino <fujino@google.com>
* [gen_l10n] keys can contain dollar sign Fixes flutter#112250 * Update packages/flutter_tools/lib/src/localizations/gen_l10n.dart Co-authored-by: Christopher Fujino <fujino@google.com>
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_localizations(gen_l10n comamnd) doesn't allow a property name to have a dollar sign ($) in any postion.
Steps to Reproduce
flutter gen-l10n
involved in any *.arb file which has a key that contains a dollar sign ($).Expected results: Dollar sign can be a part of the property name, so it should succeed.
Actual results:
gen-l10n
failed.Code sample
In app_en.arb file:
Logs
The text was updated successfully, but these errors were encountered: