Addon localization doesn't work

Godot Version

Godot Engine V4.7.2.stable.official

Question

I’m creating a card game in godot V4. To help with balancing, I’m creating a custom plugin (or addon, I’m not sure about the difference in naming) that will show the card collection in the editor (without having to start the game or whatever). So it’s really a custom addon for my project only.

The addon is a ‘main screen’ type of addon, and it shows just fine except for localization :

As you can see, it still shows the ‘unlocalized’ strings such as ‘LABEL_COST’ or ‘LABEL_BONUS_EFFECT’ when I select the addon tab in the editor.

If I start the same scene (so the addon scene) with F6 (Run current scene), then the localization works just fine :


I even tried to cheat using stuff like ‘button.text = tr(“LABEL_COST”)’, but that doesn’t help.

Is there any way I can make the localization works for the editor plugin as well?

Perhaps I can help with a plugin I developed a few weeks ago. It is designed for use within the Editor—specifically for setting and viewing localization keys—but using CSV files.

Here is the thread where I post updates and where users can leave comments:

There are two ways to use it: one is via the Inspector, and the other is by placing the “SetAndSeeButtonEditor” node. The latter is intended for use in other plugins that are integrated into the Editor. You can find full details in the repository.

I actually found the solution here : Internationalizing plugins — Documentation de Godot Engine (4.x) en français

Note : this page doesn’t exist on the english documentation, or at least I couldn’t find it. But luckily enough I stumble upon the french documentation today and there it was.

Basically I was not adding the domain for my addon. I just followed this page instruction and now it works fine.