How to translate strings to users languate app?

I’m trying to understand how to use zstring documented here:

But personally the documentation is poor and needs a small code block to understand it fully.

I’m trying the next as mentioned in the documentation:

console.log(core.translateUIString("$$$/slash/separated/key=hola mundo"));

This returns “hola mundo” only but doesn’t translate my string into my US language Photoshop.

Does someone knows how to use this?

I really don’t understand the “$$$/slash/separated/key=english default value”

Thank you!

I don’t know if you can use it to translate your own string (eg. for plugin localization) :thinking:

I believe it’s more to get localized string from Ps UI if you know the /slash/separated/key part used internally. For example, to get filter menu translation, you’d use $$$/Menu/Filter (ref)

If I’m not mistaken, @Jarda mentioned something about this briefly. IIRC you can find these keys in some old CEP docs or something.

Yeah… Don’t take it for granted, because my memory isn’t that good :sweat_smile:

1 Like

Oh, I might need to to some arrays for language changing maybe? Thanks man! Is so cool that CEP is now “old” but has so many treasures in it.

What I do for my plugins:

import { host } from "uxp"

let LanguageStrings
const language = host.uiLocale.split("_")[0]

try {
    LanguageStrings = require(`./locale/${language}.json`)
} catch (e) {
    LanguageStrings = require("./locale/en.json")
}
1 Like

I guess that en.json is your english strings right? So you have a json for each langauge?

Yeah, if it can’t find a used language JSON, it falls back to EN. Currently I tested only with EN and IT (got a translation from a user)

1 Like

Nice! seems a good manual approach! Thanks for sharing!

1 Like

On a Mac, you can find the ZStrings in the file /Adobe Photoshop 2025/Locales/en_US/Support Files/tw10428_Photoshop_en_US.dat.
If you have installed PS in a language other than en_US, the local code may be different, e.g. de_DE etc.
You can open the file with a text editing app or also with Vscode.

1 Like