Best practice to use localized strings in panel

Was searching, but couldn’t find any example.

I have my language strings in a JSON file and use them in JS without issue, but now I want to add a panel and use same strings there. What’s the way to use same JSON file strings in a panel HTML?

1 Like

Dear Karmalakas,

did you find a solution for your problem?

Sadly, no. I still have just EN strings hardcoded into HTML file. And it’s way too simple of a plugin to refactor 5 button panel into React - then it wouldn’t be an issue at all

This is fairly simple to achieve using the i18-next but it requires Next.js framework which is built on top of the React and I doubt it is supported in the UXP. And it works like you said, it uses the same labels to do a string replace by matching the same string value in every JSON file it loads.

As I mentioned, this is also very easy to do with React, but there’s just no point to refactor 5 static buttons plugin to React