KikoMart supports multiple languages out of the box. Translations are stored as JSON files in assets/language/.
Add a language#
-
In
assets/language/, create a new JSON file named after the ISO 639-1 language code, e.g.es.jsonfor Spanish. Copy all entries from
en.jsoninto the new file.-
Translate only the values (right of the colon). Don't change the keys. For example:
{ "welcome": "Bienvenido", "add_to_cart": "Añadir al carrito" } Add a flag icon in PNG format to
assets/images/, e.g.spanish.png.Register the image as a constant in
lib/app/resources/images.dart.-
Add a new
LanguageModelentry to thelanguageslist inlib/app/resources/constants.dart, with the correct language and country code.
Never modify the JSON keys. The app looks up translations by key, so a changed key shows up as missing text.
Remove a language#
Delete or comment out its LanguageModel entry in the languages list in constants.dart.
Set the default language#
Move its LanguageModel entry to the first position (index 0) of the languages
list.
Rebuild and reinstall the app after changing languages.
