Repository navigation
[gen-l10n] Localization files are auto-generated when running the project #120023
Copy link
Copy link
Closed
Closed
Copy link
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)c: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work ontoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Steps to Reproduce
- Create a new flutter project
- Setup localization using
flutter_localizationspackage from sdk
flutter_localizations:
sdk: flutter- Setup
l10n.yamlconfiguration - Generate
app-localizationby runningflutter gen-l10nin terminal or running the project - Try disabling auto generation by setting
generate: falseand not specifying it inpubspec.yaml
Expected results: Localization files should not be auto-generated on running a flutter project
Actual results: Localization files are auto-generated even after setting generate: false in pubspec.yaml.
Code sample
dependencies:
...
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
...
flutter:
generate: false
uses-material-design: trueLogs
Flutter (Channel stable, 3.7.1, on macOS 13.1 22C65 darwin-arm64, locale en-EE)
• Flutter version 3.7.1 on channel stable at /Users/christian.onwe/source/flutter
! Warning: `dart` on your path resolves to
/opt/homebrew/Cellar/dart/2.19.0/libexec/bin/dart, which is not inside your
current Flutter SDK checkout at /Users/christian.onwe/source/flutter. Consider
adding /Users/christian.onwe/source/flutter/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7048ed95a5 (3 days ago), 2023-02-01 09:07:31 -0800
• Engine revision 800594f1f4
• Dart version 2.19.1
• DevTools version 2.20.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 33.0.0)
• Android SDK at /Users/christian.onwe/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• 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.13+0-b1751.21-8125866)
[✓] VS Code (version 1.75.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.1 22C65 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Reactions are currently unavailable
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)c: regressionIt was better in the past than it is nowIt was better in the past than it is nowfound in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work ontoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
[-]Unable to disable auto-generation[/-][+][BUG]Unable to disable auto-generation[/+]andbitty commentedon Feb 5, 2023
Hi,
does the trick
kwado-tech commentedon Feb 5, 2023
Hey @superciccio thanks for your suggestion but I'm currently not using
flutter_intlpackage. Can you provide me with a context on where this is applicable.andbitty commentedon Feb 5, 2023
Hi,
see this pubspec
kwado-tech commentedon Feb 5, 2023
Hey, unfortunately, I couldnt get this working by specifying
What version of flutter was this tested on? @superciccio
huycozy commentedon Feb 6, 2023
@kwado-tech I do some tests on Flutter stable
3.7.1, master3.8.0-4.0.pre.25,3.3.10and see there is the change:❌ Flutter stable
3.7.1, master3.8.0-4.0.pre.25generateflag is true or false.✅ 3.3.10
generateflag is true or false. It's only generated when executinggen-l10n.✅: No Issue ❌: Issue reproduced
Labeling this as a regression issue for further investigation. Thanks for your report.
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.1, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.7.1 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 7048ed95a5 (11 hours ago), 2023-02-01 09:07:31 -0800 • Engine revision 800594f1f4 • Dart version 2.19.1 • DevTools version 2.20.1 [✓] 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 Dolphin 2021.3.1.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14B47b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio Dolphin 2021.3.1.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.13+0-b1751.21-8125866) [!] 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 ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio. [✓] 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.74.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.58.0 [✓] Connected device (4 available) • RMX2001 (mobile) • EUYTFEUSQSRGDA6D • android-arm64 • Android 11 (API 30) • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios • iOS 15.7.2 19H218 • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 109.0.5414.119 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category.[-][BUG]Unable to disable auto-generation[/-][+][gen-l10n] Localization files are auto-generated when running the project[/+]huycozy commentedon Feb 6, 2023
@kwado-tech I updated the issue title even though it's not mentioned the way to disable auto-generation. Please let me know if it's applicable to you.
kwado-tech commentedon Feb 6, 2023
@huycozy thanks for the feedback. Yes the title is okay and applicable to my situation.
christopherfujino commentedon Feb 7, 2023
@thkim1011 do you by any chance know if this is working as intended or a bug?
thkim1011 commentedon Feb 7, 2023
generate: falseonly affects whether synthetic packages are allowed or not, not whether localization files are generated onflutter run. That said, expected behavior is forgenerate: falseto throw an error if set up as a synthetic package, so I'll take a look at this.christopherfujino commentedon Feb 14, 2023
@thkim1011 marking this p3 as you're working on it, feel free to re-prioritize as appropriate
Refactor "gen-l10n" command to use same code path when "l10n.yaml" is…
github-actions commentedon May 10, 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.