Hamburger and Page Translation

The selected menu item in Hamburger is identified by the displayed value:

Hamburger1.onclick = function(s) {
if (typeof(s) == "object") {
return;
}
NSB.MsgBox("Choice is " + s);
if (s == "Sign Out") {
// Do code for sign out.
}
...
}

If we enable page translation like Chrome does, for example, to Spanish, then instead of “Sign Out” we will have “Desconectar” and then the condition:

if (s == "Sign Out") {
// Do code for sign out.
}
// s = "Desconectar"

will not be true.

Is there a solution for this?

You can also get the index of which item was selected:

if (Hamburger1.index == 0) {
// Do code for sign out, assuming it's the top item in the list
}
// s = "Desconectar"
1 Like