Easy_localization: What differences between langs files ?

Created on 11 May 2020  路  7Comments  路  Source: aissat/easy_localization

what is the differences between using (en-US.json, en.json)?
and when use langs.csv ?

can I only make all translation in langs.csv like above and use it to create LocalKeys ? and How that?

question waiting for customer response

All 7 comments

@AdelMahmoudHussein
easy_localization give u more choice coz supports JSON by default, CSV, Yaml, XML Files ... need use Easy Localization Loader
about LocalKeys generated by easy_localization tool currently supported JSON file

$ flutter pub run easy_localization:generate -h
-s, --source-dir     Source folder contains all string json files
                    (defaults to "resources/langs")
-O, --output-dir     Output folder stores generated file
                    (defaults to "lib/generated")
-o, --output-file    Output file name
                    (defaults to "codegen_loader.g.dart")
-f, --format         Support json, dart formats
                    [json (default), keys]

flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart

Thank you very much, but How can I get the device default language, and how to use it as the first localization of my app ?

@AdelMahmoudHussein Easy localization default get locale from device, but if you change locale will be save. For disable save use saveLocale: false. If you need override device locale use 'startLocale'

Thanks,
What is the scenario if device is for example ar_EG and there is no ar_EG in my locales but have ar_DZ ?

Do I need to add all languages with its country code in my locales ?

Thanks,
What is the scenario if device is for example ar_EG and there is no ar_EG in my locales but have ar_DZ ?

Do I need to add all languages with its country code in my locales ?

no not requird added country code for ur locales, u can use useOnlyLangCode: true

@aissat @Overman775
Thank you all very much, now I can do it.

You're welcome

Was this page helpful?
0 / 5 - 0 ratings