Multiple language support in i3 pro
This example demonstrates creating a user interface for i3 pro in several languages. To implement it, use the built-in iRidi Studio tool, Script editor.
Documentation updated 01.01.2024
- Open iRidi Studio and create a Panel Project.

- Add several graphical items to the interface and fill in the Text field for each.

- Create a new script in Script editor and add this code:
var button_translate = IR.GetItem("Page 1").GetItem("Item 1");
// dictionary:
var dictionary = {
// ENG to RU
"Text 1": "Текст 1",
"Text 2" : "Текст 2",
"Translation" : "Перевести",
// RU to ENG
"Перевести": "Translation",
"Текст 1": "Text 1",
"Текст 2": "Text 2"
}
function find_dictionary_value_by_key(key) {
var value = dictionary[key];
if(value)
return value;
return key;
}
function change_text_item_by_dictionary(page) {
if(page) {
IR.Log(page.ItemsCount);
for(var j = 0; j < page.ItemsCount; j++) {
var item = page.GetItem(j);
item.Text = find_dictionary_value_by_key(item.Text);
}
}
}
function translate_all_pages_and_popups() {
for(var i = 0; i < IR.PagesCount; i++)
change_text_item_by_dictionary(IR.GetPage(i));
for(var i = 0; i < IR.PopupsCount; i++)
change_text_item_by_dictionary(IR.GetPopup(i));
}
IR.AddListener(IR.EVENT_ITEM_RELEASE, button_translate, translate_all_pages_and_popups);
- Replace the words in the script with the words you want to translate in the graphical interface.

Tip
- The script iterates through all items on a page, finds the corresponding text in the dictionary, and replaces it with the selected translation.
- Translation takes place on all project pages and popups at once.
- In the first line, replace the graphical item with the one that will trigger text translation when clicked. The last line of code subscribes to the event triggered by clicking the specified button.

- Start the i3 pro emulator. Clicking Translation switches the project language from English to Russian.