Copy link to clipboard
Copied
I've reached a dead end
I would like to make the panel change the language based on the country of use,
unfortunately I stopped and I can't go on,
up to now I have managed to set 2 languages,
I would like to set another 2 or 3
this is my starting script.
const host = require('uxp').host;
const locale = host.uiLocale;
if (locale == "en_US" ){
english();
}else{
france();
}
I tried this method but had no luck
const host = require('uxp').host;
const locale = host.uiLocale;
if (locale == "en_US" ){
english();
}else{
france();
}else{
espana();
}
I hope there is a solution
I am not up to speed with USP Scripting but you seem to have one if-clause and two else-clauses.
So the numbers don’t seem to add up and you may need a second if-clause to verify »frenchness« before »defaulting« to Spanish.
Edit: Alternatively you could try using a switch-clause.
if (locale == "en_US") {
english();
} else if (locale == "it_IT") {
italy();
} else if (locale == "es_ES") {
spanish();
} else {
defaultLanguage();
}
}@pfaffenbichler
thanks to your help I solved it this way
thanks
Copy link to clipboard
Copied
I am not up to speed with USP Scripting but you seem to have one if-clause and two else-clauses.
So the numbers don’t seem to add up and you may need a second if-clause to verify »frenchness« before »defaulting« to Spanish.
Edit: Alternatively you could try using a switch-clause.
Copy link to clipboard
Copied
I tried this way but it doesn't work
const host = require('uxp').host;
const locale = host.uiLocale;
if (locale == "en_US" ){
english();
}else{
france();
}
if (locale == "es_ES" ){
espana();
}
}
do you have an example of how to set a second if
Copy link to clipboard
Copied
if (locale == "en_US") {
english();
} else if (locale == "it_IT") {
italy();
} else if (locale == "es_ES") {
spanish();
} else {
defaultLanguage();
}
}@pfaffenbichler
thanks to your help I solved it this way
thanks
Find more inspiration, events, and resources on the new Adobe Community
Explore Now