ensemble icon indicating copy to clipboard operation
ensemble copied to clipboard

Ability to change the language of the UI (i18n)

Open amin-nas opened this issue 1 year ago • 4 comments

As an app developer, I want to be able to provide multiple languages, and have an action that allows me to switch the language within the UI:

Button:
  onTap:
    setLanguage:
      language: es  # change to this. Also provide option of userDefault, which will adhere to user's device/browser default language
      fallback: en  # if es does not exist, fallback to this
      onComplete:
         # expose event so that I can perform an action
      onError:
         # expose event so that I can perform an action

Provide same ability in code:

ensemble.setLanguage({
   "language": "es",
   "fallback": "en"
);

amin-nas avatar Feb 05 '24 14:02 amin-nas

More context: A user may want to have a dropdown (in-App) that allows the user to select a language. All the infrastructure is there to switch language, and some of the code is there in https://github.com/EnsembleUI/ensemble/tree/translation_runtime but it doesn't work yet. THe problem seems to be inside the flutter_i18n we used or our DataTranslatorLoader.

vusters avatar Apr 19 '24 20:04 vusters

SEnding this to you @snehmehta.

vusters avatar Apr 19 '24 20:04 vusters

sorry for the ping pong, looks like I won't be able to get to it this week. Assigning back to @snehmehta as he understands the issue better anyway.

kmahmood74 avatar Apr 24 '24 22:04 kmahmood74

@amin-nas did it by accident, assigning back to Sneh

kmahmood74 avatar May 03 '24 00:05 kmahmood74

https://docs.ensembleui.com/translations#changing-language-in-screens-using-script

amin-nas avatar Jul 08 '24 12:07 amin-nas