Skip to main content
Vamitul
Legend
October 28, 2015
Question

"Translate" a locale-independent key string to arbitrary locale?

  • October 28, 2015
  • 2 replies
  • 708 views

Hi all,

This has been bugging me to no end:
I can get the key string for the current locale easily by calling:

app.findKeyStrings('[Basic Paragraph]')

//result: $ID/NormalParagraphStyle

But now I need to "translate" that key string into a different locale (let's say French?)

app.translateKeyString('$ID/NormalParagraphStyle') will only return '[Basic Paragraph]'.

Is there any way to do it except creating some giant lookup table that will probably never be up to date?

This topic has been closed for replies.

2 replies

Vamitul
VamitulAuthor
Legend
October 29, 2015

Uwe, Trev, thanks.

Unfortunately none of the above would work for me. What i am trying to achieve, in short:
I have an input xml that (among a lot of other things) can contain specified paragraph and character styles.

The xmls can come from a variety of systems and locales so they can contain stuff like "[Einf. Abs.]" or "[Basic Paragraph"] or " [Paragraphe standard]" and i need all of them to map to "$ID/NormalParagraphStyle".

And, of course, the same thing is valid for almost any translatable indesign stuff (character styles, table styles, colours etc)

Trevor:
Legend
October 29, 2015

Hi Vamitul,

I would guess it would be very tough to do that on the fly.  And you would have to somehow collect all the translations strings in advance and store them as a json file or something.

The localized strings are stored as  Zstrings in the presets folder (after you've installed all the localizations using the methods above.

This post should be very helpful of how to go about it Localized Presets/Actions folder?

It's more likely that the SDK guys know more about it.

This post might be of some use strings in JavaScript and localization question Dirk would probably know how to do it.

For gaps that might be in the dictionaries maybe for Gelb, Gul or Jaune you could fill in manually.

Make sure to come back with a report of how you managed to get it done!

Regards

Trevor

Community Expert
October 29, 2015

Just some side notes:

A basis swatch like "C=100 M=0 Y=0 K=0" is named the same in a German and an English InDesign. But you cannot be sure about that of any other local installation of InDesign.

So, if the "same" color is used in a French originated inDesign document the name would be different. Besides individual locale strings, we have to look at the abbriviations, that would be automatic set for CMYK (and maybe other things as well).


app.translateKeyString() would not do that for us.

Another field of locale strings is in the property space of a placed image.

In English it might be "Grayscale", if you ask my German InDesign it is "Graustufe".
What to do about that?

Uwe

Community Expert
October 28, 2015

Hi Vamitul,

to get the specific locale string, you need the specific local version of InDesign installed.


I once tried the method app.translateKeyString().

It's doing, in a very narrow sense, what it is supposed to do.

app.translateKeyString('$ID/NormalParagraphStyle');

So if you have the English version of InDesign installed, you will get "[Basic Paragraph]".

I will get "[Einf. Abs.]", because my German version is the target.

Uwe

Trevor:
Legend
October 28, 2015

Hi All

For multiple languages installs there's quite a few methods.

See https://indesignsecrets.com/change-ui-language-indesign-cs6-cc.php

and http://www.indiscripts.com/post/2009/10/switching-indesigns-ui-language-in-windows

for changing the language settings.

Also one can through CC download multiple installations of the same app in different languages by changing the download language preferences.

You then change the OS language and the appropriate ID version will be loaded.

I think I've got the entire range on my system.

Of course all this is not very useful if you have to do it on a client's system.

HTH

Trevor