easy_localization
easy_localization copied to clipboard
[🌎 Easy Localization] [WARNING] Localization key [app_name] not found
I set title to my MaterialApp.router as title: tr(LocaleKeys.app_name) but the app_name value always not found!
with warning [🌎 Easy Localization] [WARNING] Localization key [app_name] not found!
To localize app name in Android you need
-
Create file android/app/src/main/res/values/strings.xml add localization JSON file for example assets/translations/fr.json with
BMI Family -
create folder, for example for French localization /android/app/src/main/res/values-fr/
-
create a file /android/app/src/main/res/values-ru/strings.xml
type here app Name in French -
in file /android/app/src/main/AndroidManifest.xml change your current android:label= "..." to android:label="@string/app_name_launcher"
to add another localizaton just repeat steps 2 and 3
For iOS localization you can check that tutotial https://youtu.be/6ZIYdNa2c84
Thanks for your help. but this issue is related to the app title not the launcher name.
@EhabSalah have you been able to find a solution? I'm facing the same problem.
problem is still continuing. Is there anyone solved the problem?
You can use onGenerateTitle: (_) => LocaleKeys.appName.tr(), instead of title
The problem is that the delegates are added to the context by the MaterialApp, so it will be only available in a context blow the MaterialApp. Therefore, the solution found by @KuzmenkoEvgenij should work.