easy_localization icon indicating copy to clipboard operation
easy_localization copied to clipboard

[🌎 Easy Localization] [WARNING] Localization key [app_name] not found

Open EhabSalah opened this issue 3 years ago • 5 comments
trafficstars

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!

EhabSalah avatar Jan 06 '22 11:01 EhabSalah

To localize app name in Android you need

  1. Create file android/app/src/main/res/values/strings.xml add localization JSON file for example assets/translations/fr.json with BMI Family

  2. create folder, for example for French localization /android/app/src/main/res/values-fr/

  3. create a file /android/app/src/main/res/values-ru/strings.xml type here app Name in French

  4. 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

Joldersman avatar Jan 18 '22 10:01 Joldersman

Thanks for your help. but this issue is related to the app title not the launcher name.

EhabSalah avatar Jan 22 '22 17:01 EhabSalah

@EhabSalah have you been able to find a solution? I'm facing the same problem.

jenshor avatar May 02 '22 10:05 jenshor

problem is still continuing. Is there anyone solved the problem?

aea91 avatar May 21 '22 06:05 aea91

You can use onGenerateTitle: (_) => LocaleKeys.appName.tr(), instead of title

KuzmenkoEvgenij avatar Jul 02 '22 15:07 KuzmenkoEvgenij

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.

bw-flagship avatar May 14 '23 11:05 bw-flagship