Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multilingual Support

Explorer ,
Apr 09, 2019 Apr 09, 2019

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.

3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 10, 2019 Apr 10, 2019
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
...
Translate
Engaged ,
Apr 09, 2019 Apr 09, 2019
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 09, 2019 Apr 09, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 09, 2019 Apr 09, 2019

Create the folders and files as mentioned in the documentation:

Bildschirmfoto 2019-04-09 um 19.11.12.png

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Apr 04, 2020 Apr 04, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Apr 04, 2020 Apr 04, 2020
LATEST

I think i should check the local.html page in samples right? I see one in CEP7 samples folder

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 09, 2019 Apr 09, 2019

Clicked the wrong button. I edited my post before.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 09, 2019 Apr 09, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 10, 2019 Apr 10, 2019
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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines