Localization of UI controls without using code

Godot Version

4.1

Question

Is there a way to set localized text to controls not from the code. I want to configure it in UI editor using same keys as in tr function.

like, you put the key localization text on label and the godot will translate it for you based on your localization translation table when you run it?
that’s exactly what godot does, you just need to set the localization and when you type anything in label that has the key for translation, it will automatically convert it because auto translate is always on on default control node Control — Godot Engine (stable) documentation in English

1 Like

I think I do something wrong because it doesn’t work for me. Here what I’m doing.

In code I get required behavior with next line:

$Label.text = tr("order_attack_label")

If I set label’s text to order_attack_label then in runtime I receive exactly the same text, without any translation - “order_attack_label”.
image

probably you do something wrong with localization, show your localization translations tab?

i’m assuming the auto translate is never touched and is ON right now

OK, maybe something wrong was with localization file(s). I deleted all localizations, recreated them and everything works. Thank you for confirming how it should work!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.