Repository navigation
Open
Labels
P3Issues that are less important to the Flutter projecta: internationalizationSupporting other languages or locales. (aka i18n)found in release: 3.19Found to occur in 3.19found in release: 3.21Found to occur in 3.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team
Description
Steps to reproduce
- Create a Form in your Flutter App using a
TextFormField(). - Localize your Flutter app according to the docs.
- Build simple form validation according to the docs, by returning a localized string via the
validator(e.g.AppLocalizations.of(context).myTranslation). - Test the app using
flutter run, and provide invalid input and trigger validation. - This will show an according error message displayed in the current app locale.
- Trigger a locale language switch in your app (we're currently doing this using a provider to whose value the
localeproperty of theMaterialApp/CupertinoApplistens to).
Expected results
The locale should be switched in the entire app, to the language to which the locale switch occurred.
Actual results
Every string present in the app via AppLocalizations.of(context)... changes, except for the strings returned via the validator property in the TextFormField() widget & displayed in the way mentioned above before the language switch. Only a new call to formKey.currentState.validate() will refresh the validation error messages according to the newly selected language.
This issue has also been mentioned on so, still without a really viable solution.
Code sample
Code sample
you may consider https://stackoverflow.com/questions/52217090/internationalization-problem-when-i-switch-languages as an example.Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.2.1 23C71 darwin-arm64, locale de-CH)
• Flutter version 3.16.4 on channel stable at /Users/inkognito/dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2e9cb0aa71 (2 months ago), 2023-12-11 14:35:13 -0700
• Engine revision 54a7145303
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/inkognito/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.14.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.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 17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.3.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 77.3.1
• Dart plugin version 233.13763.5
[✓] Connected device (3 available)
• iPhone 15 Pro Max (mobile) • 1EF3E08B-D6C6-4D80-89B7-A97F5CDA6C61 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71
darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome
119.0.6045.159
[✓] Network resources
• All expected network resources are available.
• No issues found!
Reacted by adonisRodxander
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projecta: internationalizationSupporting other languages or locales. (aka i18n)found in release: 3.19Found to occur in 3.19found in release: 3.21Found to occur in 3.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team
Activity
dam-ease commentedon Feb 20, 2024
Thanks for filing this @fulstadev.
I seem to be missing out on a step, can you please provide a minimal complete reproducible code sample that doesn’t include 3rd party plugins or complex production code?
github-actions commentedon Mar 12, 2024
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
fulstadev commentedon Mar 24, 2024
So it took us some time to make an example that is as simple as possible and represents our app as good as possible, so there you go, step-by-step:
/pubspec.yml:/l10n.yml:/lib/l10n/app_de.arb:/lib/l10n/app_en.arb:/lib/main.dart:We explicitly want to enable in-app localization, independently of the locale set for the device, during runtime. To visualize our problem, with the app code above:
flutter run.Validate Formbutton without providing any text to the text form field.Sample Error Message.Switch Languagebutton. Everything in the App changes to german, except from the error message of the text form field.Validate Formbutton again, and the error message now shows up in german (which we expected to happen after step 4.).flutter doctor -voutput:darshankawar commentedon Mar 25, 2024
Thanks for the detailed steps to replicate and code. Using it, I was able to replicate the reported behavior.
stable, master flutter doctor -v
xhejmspuka commentedon May 13, 2024
any update on this?
Hamza3620 commentedon May 17, 2024
Hi, I am facing the same issue. Any update on the fix please?
Hamza3620 commentedon Aug 15, 2024
Hi @darshankawar ! Would this be resolved in versions 3.22.0 or 3.24.0?
I can still reproduce on 3.19.6, so I look forward to a response if upgrading could fix this.
Thanks!
loic-sharma commentedon Aug 22, 2025
I suspect to fix this we need to re-run
FormField.validators when dependencies change. This would ensure that we rebuild error messages when the locale changes. This might require adding acontextargument to theFormFieldValidatorcallback so that theTextFormFieldcan be aware of itsvalidator's dependencies.pro100andrey commentedon Oct 20, 2025
Hello everyone, I also ran into this problem and want to share my temporary workaround:
Code
How to use:
pedrisbel commentedon Jun 24, 2026
any update? same issue