Web ContextualMenu & Language

I am building a multilingual tool that is using a Contextual Menu. From what I can find in the documentation, I can only reference the “text” to know what menu item was chosen, not an index number. Does anyone now of a way to do this without having to write a Select Case for every language option?

Example: Right now I’m referencing the Item.text “Edit Item”, but that is very language dependant. What I would rather reference is the Item.Index so that if it is Item.Index(0) then it would do something (edit in this case).

select case Item.Text
case "Edit Item"
  //Do some edit things
case "Delete Item"
 //Do some delete things
end select

If you use dynamic constants, you can refer to the name of the dynamic constant, and never have to worry about the actual text.

select case Item.Text case EditItem //Do some edit things case DeleteItem //Do some delete things end select

EditItem and DeleteItem are dynamic constants, with variable value depending on the system language. That is how my apps work between English, French and Spanish.

if your using dynamic constants then make your select case also use the dynamic constant
each session has a language code you can use to get the right dynamic constant value

Picking A Language At Runtime – Xojo Programming Blog

Merci Michel, reading through your answer provided a forehead slap moment as it is so obvious once it is pointed out.

Norman, I’m in Canada, and some of the people using the web application will be using an English OS, but want the application to be in French. I’m very thankful for the fact I’m able to configure the language output at runtime (Language(“fr”)).