Copy link to clipboard
Copied
Hi, I have an extension which I have created 3 different versions (greek, german, english) in order to sell to multilingual customers. Is there a possiblily to create a hybrid that triggers the appropreate version according the language of Photoshop that the user uses?
Any help or hint will be useful because it gets confusing having 3 different versions of the same extension.
I need to create a new folder called "locale" and inside create a set of other folders according to my translations (greek version, deutsch version and english).
Correct.
What I will put in those folders, an js file that that leads the extension to use the right files according to the language the user uses.
No. You put in a file with the name messages and the extension .properties. .properties - Wikipedia
In your main js file you can read the content.
...
Lets say that in the above structure, I have in
Copy link to clipboard
Copied
You are talking about CEP HTML panels, right?
It's possible:
CEP-Resources/CEP 9.0 HTML Extension Cookbook.md at master · Adobe-CEP/CEP-Resources · GitHub
Copy link to clipboard
Copied
Yes I am talking about CEP HTML Extension.
Thank you for the info, I am glad that it's possible. But how do I trigger that? Should I add something in the Manifest.xml?
I am trying to realize how it works.
Copy link to clipboard
Copied
Create the folders and files as mentioned in the documentation:
For example the content of the messages.properties in the "locale" folder (if the file is placed here, always this file will be used if there is no *.properties file set for a specific language) could look like this:
helloWorldString=Hello World!
The content of the messages.properties in the de_DE folder (german):
helloWorldString=Hallo Welt!
helloWorldString=Hello World!h
Get the translated String it Javascript:
var csInterface = new CSInterface();
csInterface.initResourceBundle();var localizedString = resourceBundle.helloWorldString;
Copy link to clipboard
Copied
Can i ask how use assign the variable to items. When i look at the ADobe panels, they are made of couple 100 variables. When i check for instance there main.js i see a function which gets this messages.properties but its again assigned to a variable name. How are they assign each row or variable name to its target?
For instance the first line is DL_CANCEL in the panel_extension_3_7_76 how does this variable get to the correct location when all they use is variable links? Or do they simply count all rows and loop over them so for that button it could be <button>$localized(lan_files[1])</button> Where as lan_files is simply the array they use to store all lines from messages.properties.
Im not a developer but I'm trying to figure out this thing
Copy link to clipboard
Copied
I think i should check the local.html page in samples right? I see one in CEP7 samples folder
Copy link to clipboard
Copied
Clicked the wrong button. I edited my post before.
Copy link to clipboard
Copied
Thank you very much!
So lets say (if I understad correct) that I have an extension with the following structure:
---CSXS
---icons
---js
---jsx
---Meta-INF
---MainExtensionFolder
I need to create a new folder called "locale" and inside create a set of other folders according to my translations (greek version, deutsch version and english).
What I will put in those folders, an js file that that leads the extension to use the right files according to the language the user uses.
How can that be possible?
Lets say that in the above structure, I have in the "Icons" folder a greek, german and english flag. I would like the extension to load the correct flag once it "reads" the language of the user's system or Photoshop's.
PS: Sorry for my silly questions, I need to realize how this works.
Copy link to clipboard
Copied
I need to create a new folder called "locale" and inside create a set of other folders according to my translations (greek version, deutsch version and english).
Correct.
What I will put in those folders, an js file that that leads the extension to use the right files according to the language the user uses.
No. You put in a file with the name messages and the extension .properties. .properties - Wikipedia
In your main js file you can read the content.
Lets say that in the above structure, I have in the "Icons" folder a greek, german and english flag. I would like the extension to load the correct flag once it "reads" the language of the user's system or Photoshop's.
You can store the path of the image in the messages.properties file.
Another way:
Get the actual Photoshop language code with
var csInterface = new CSInterface();
var hostEnv = csInterface.getHostEnvironment();
var languageCode = hostEnv.appUILocale;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now