Question about using Localization Variables in custom JS/CSS/HTML pages

Hi everyone,
I have a question regarding localization manager / variables in WebIQ.

Is it possible to use localization variables inside custom JavaScript, CSS, and HTML widgets/files, so that a fully custom page built with a combination of these three changes language automatically when the user clicks an UI Action “SetLocale” (for example, triggered by clicking on a flag used as an image changer)?

For example:
I have an HTML table with the columns “Name”, “Surname”, and “Address”, populated via a REST API in JS code.
On top of each column there are dynamic checkbox filters, generated also via JavaScript, to conveniently filter the table data.

Is there a way to localize:

  • the table headers (Name, Surname, Address),

  • and the dynamically generated filter labels,

without having to write separate code for each language?

Ideally, I would like to reuse localization variables, similar to how they are used in standard WebIQ widget labels, so that everything updates automatically when the locale changes.

Has anyone implemented something similar, or can confirm whether this is supported in WebIQ?

Thanks in advance for any hints or best practices!

Best reply by HmiGuide

Yes, just use the function shmi.localize("${myLocalizeVariable}")

View original
5 replies