Buy

Flutter Translation Setup

1.Introduction

We already fetched the languages in translation list.

If you want to change language or add any other language to the application, you can follow the below instruction.

2.Setup Instructions


  • Go to admin panel
  • click on "Masters" and then click the "Languages" in dropdown
  • click "+ Add New Languages"
  • select the language you want to add and then
  • select the language direction you want to add
  • Select the selected language direction then save that
  • after saved you will see which you saved the language in see language list
  • then click the action below the global icon
  • then click on "Select Group" dropdown,select User App / Driver App any one you want to change the language
  • click on "Download Translations", file will be download
  • After download the (translate).arb file, rename it to "intl_(new language code).arb" ,Ex: (if it is arabian language, file name: intl_ar.arb)
  • add it to the below direction of your project.
  • "project/lib/l10/"

  • After place the file, run the below comment in project terminal
  • 
    flutter gen-l10n
    
  • then add the language name and language code to the below direction of your project.
  • "project/lib/common/app_constants.dart"

  • add the language to the existing languageList
  • 
     static List languageList = [
        LocaleLanguageList(name: 'English', lang :'en'),
        LocaleLanguageList(name: 'Arabic', lang: 'ar'),
        LocaleLanguageList(name: 'French', lang: 'fr'),
        LocaleLanguageList(name: 'Spanish', lang: 'es'),
        LocaleLanguageList(name: "new language name here" , lang: 'new language code here'), * newly added language 
      ];