Language Configs
In this section you can learn how to add or remove more languages in the application using android studio.
#
Add New LanguageTo add new language in the application you will need to create some files. This guide will create new files using android studio.
Open android studio on your machine.
Open
Plugins
window fromPreferences
on macOS andSettings
on Windows.Select
Marketplace
option from the top tabbar.In the search field enter
Flutter Intl
.Click on
Install
andApply
. You will need to restart android studio for the plugin to be activated.From the
Tools
menu option selectFlutter Intl
and click onAdd locale
.info
Checkout this link to see the names and code of the locales supported: Official Support Locales
Add the
language code
in the field and clickOk
. For example is we were to add Arabic then we will writear
in the field.This will create a new
intl_xx.arb
file in thewoostore_pro / lib / l10n
directory. This file will be empty by default.Open the
intl_en.arb
file fromwoostore_pro / lib / l10n
directory in android studio. Copy all the contents of the file and paste it into the newly createdintl_xx.arb
file.Replace the
@@locale
key value with the language code of the new language you created.intl_en.arbintl_xx.arbReplace the
xx
with the actual language code.Finally
Save
the file by pressingcommand + s
on Mac andcontrol + s
on Windows.
You will also need to enter some more modifications in the application to show an option to change the locale to the newly added language. Follow the steps below to add the same.
Open
languages.dart
file in android studio. This file is located inwoostore_pro / lib / constants / languages.dart
Edit the
kSupportedLanguages
variable with the new language entry.The following is the structure of each language entry in the application. You need to follow the same pattern while adding the new entry.
The
asset
in the above code snippet is anSVG
format file which represents the flag of the corresponding country. You need to add the asset inwoostore_pro / lib / assets / svg / flags
directory. Make sure the same is same as you enter in the asset field above.
#
Remove LanguageFlutter Intl
plugin#
If you have installed From the
Tools
menu option selectFlutter Intl
and click onRemove locale
.Select the
language code
from the dropdown and clickOk
. For example is you were to remove Arabic then you will selectar
in the field. This will remove the language from the application.
Flutter Intl
plugin#
If you have not installed Open android studio on your machine.
Open
Plugins
window fromPreferences
on macOS andSettings
on Windows.Select
Marketplace
option from the top tabbar.In the search field enter
Flutter Intl
.Click on
Install
andApply
. You will need to restart android studio for the plugin to be activated.From the
Tools
menu option selectFlutter Intl
and click onRemove locale
.Select the
language code
from the dropdown and clickOk
. For example is you were to remove Arabic then you will selectar
in the field. This will remove the language from the application.