Skip to main content

Language Setup

1- Open file on this path lib/helpers/config.dart.

then you find this code in config.dart:

'languages': [
{
'code': 'en',
'countryCode': 'GB',
'title': 'English',
'flag': 'assets/icons/Countries/GB.svg',
'enabled': true,
},
{
'code': 'ar',
'countryCode': 'SA',
'title': 'Arabic',
'flag': 'assets/icons/Countries/SA.svg',
'enabled': true,
},
{
'code': 'fr',
'countryCode': 'FR',
'title': 'French',
'flag': 'assets/icons/Countries/FR.svg',
'enabled': true,
},
{
'code': 'es',
'countryCode': 'ES',
'title': 'Spanish',
'flag': 'assets/icons/Countries/ES.svg',
'enabled': true,
},
{
'code': 'de',
'countryCode': 'DE',
'title': 'Dutch',
'flag': 'assets/icons/Countries/DE.svg',
'enabled': true,
},
{
'code': 'ru',
'countryCode': 'RU',
'title': 'Russian',
'flag': 'assets/icons/Countries/RU.svg',
'enabled': false,
},
{
"code": "pt",
"countryCode": "PT",
"title": "Portuguese",
"flag": "assets/icons/Countries/PT.svg",
"enabled": false
}
],

on the languages list you can add new languages or enable/disable existing languages , in the case of language exist you can just disable the rest by changing the value of enabled to false , or keep them

in case of language dosnt exist you can add it by adding a new object to the list , and set the values of the object to the new language you want to add. just make sure info added is correct and both code and countryCode are correct and title correct language name in english , and enabled is set to true.

then add The flag of the new language by adding the flag image to the folder assets/icons/Countries and add the name of the image to the flag value of the object make sure name of The svg file is countryCode.svg and they are both matches , you can always compare your newly added language to the existing ones.

Languages flags

last step will be create a json file with all the translations for the language you just added , the file neeed to be named with same name as the language code , and the file should be in the folder assets/i18n example ar.json , and the json file should be in the following format :

make sure to add the translation of the new language as well language-subtitle-your-language-title like the prevouis languages and the translation need to be added to other languages json files as well

{
"title-home": "Home",
"title-apps": "Apps",
"title-settings": "Settings",
"language": "Language",
"language-subtitle-english": "English",
"language-subtitle-arabic": "Arabic",
"language-subtitle-french": "French",
"language-subtitle-spanish": "Spanish",
"language-subtitle-dutch": "Dutch",
"language-subtitle-russian": "Russian",
"language-subtitle-portuguese": "Portuguese",
"language-subtitle-your-language-title": "Language Title Translation",
"appearance": "Appearance",
"notification": "Notifications",
"clear-cache": "Clear Cache",
"terms-services": "Terms & Services",
"tool-settings": "Settings",
"follow-us": "Follow us",
"title-about": "About",
"btn-next": "Next",
"btn-skip": "Skip",
"btn-done": "Done",
"btn-back": "Back",
"version": "Version",
"title-library": "Library",
"more-apps": "More apps",
"title-player": "Player",
"btn-share": "Share",
"btn-play": "Play",
"play-all": "Play all",
"check": "Check",
"by": "by",
"in": "in",
"tooltip-shuffle": "Shuffle",
"tooltip-previous": "Previous",
"tooltip-pause": "Pause",
"tooltip-next": "Next",
"tooltip-repeat-one": "Repeat One",
"tooltip-repeat-all": "Repeat All",
"tooltip-repeat-no": "No Repeat"
}

now you just have to translate the values of the json file to the language you just added make sure everything is correct then save all the files and rebuild your application.