Skip to main content
dublove
Legend
Jul 2, 2025 12:21 PM UTC
Answered

How does the script automatically select the UI interface language based on the windows system?

I saw a script here.
https://github.com/gsingelmann/indd_autocolumn/tree/master 

 

The author (Gerald Singelmann) seems to have set "en" "de" "it" three languages, is it possible to automatically choose to display the appropriate language interface according to different windows systems.
I tried to add cn and nothing seems to change anything.

var sAutoColumn = {  en: "AutoColumn2...", de: "AutoSpalte2...", it: "AutoColumn2..."}

if (app.selection.length) {
    app.doScript(autoSpalte, undefined, undefined, UndoModes.ENTIRE_SCRIPT, localize(sAutoColumn));
}
 
dublove
dubloveCorrect answer
Legend
Jul 3, 2025 4:26 AM UTC

It might be wrong. What does $.locale give you?


@m1b @Dirk Becker 

Thank you.

According to Dirk Becker's pointers, I found iso639 language code.
Chinese code is zh.
and added $.localize = true;
to enable localization.
It worked.

6 replies

Legend
Jul 3, 2025 3:47 AM UTC
m1b
Community Expert
Community Expert
Jul 2, 2025 12:40 PM UTC

@dublove  can you try this please?

var sNoSelection = {
    "en": "Place the cursor inside a table",
    "de": "Platzieren Sie den Cursor in einer Tabelle.",
    "it": "Posiziona il cursore all'interno di una cella",
    "zh-CN": "将光标放在表格内",
    "zh-TW": "將遊標放在表格內",
};

alert(localize(sNoSelection));

 

Let me know if it works on your system. You can also try this:

alert($.locale);

- Mark 

Translate
dublove
dubloveAuthor
Legend
Jul 2, 2025 2:14 PM UTC

@m1b 

Hi m1b.
This js is reporting errors straight away.
I've tried it and it's still displaying the English interface.
I think the representation of zh-CN is wrong.

Translate
m1b
Community Expert
Community Expert
Jul 2, 2025 5:50 PM UTC

It might be wrong. What does $.locale give you?

Translate