Skip to main content
Known Participant
April 9, 2019
Answered

Multilingual Support

  • April 9, 2019
  • 1 reply
  • 3550 views

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.

This topic has been closed for replies.
Correct answer tomzag

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.


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;

1 reply

tomzag
Inspiring
April 9, 2019
Known Participant
April 9, 2019

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.

tomzag
Inspiring
April 9, 2019

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;