Localize Dynamically

Merry Christmas and a Happy New Year to you all !

I have a localisation table for languages which is selected as a USERSETTING()

The code below works well, however, I’d like the option for users to add their own language. At the moment, this would need me to re-code each SYSTEM TEXT to include this by adding a new line of text to the SWITCH code.

SWITCH(
[Language Option],

"English", LOOKUP("English", Localise, "Language", "Share"),
"Magyar", LOOKUP("Magyar", Localise, "Language", "Share"),
"Espanyol", LOOKUP("Espanyol", Localise, "Language", "Share"),
"New Language", LOOKUP("New Language", Localise, "Language", "Share"),

"Share"

)

The table looks like this…

Do any of you clever people have an answer?

Much appreciated… :slight_smile:

Instead of using SWITCH, read the value directly with LOOKUP.
LOOKUP(Usersettings(“Language”),“localise”,“Language”,“Share”).

1 Like

Try this:

ANY(
  LIST(
    LOOKUP(
      USERSETTINGS("Language Option"),
      "Localise",
      "Language",
      "Share"
    ),
    "Share"
  )
  - LIST("")
)

Excellent!
Many thanks both of you! :slight_smile:
Happy New Year to you both!

1 Like