RichTextLabel and localization. In the CSV file, I set KEY_PLAY corresponding to "Play". When I use the following method, it will display "play" correctly. However, if I add a little tag, it won't display correctly. How can I make RichTextLabel display the corresponding translation characters correctly?

label.text = "KEY_PLAY"
label.text = "[center]KEY_PLAY[/center]"

The first kind can display "play", while the second one will display [ center]KEY_PLAY[/center] instead of centered "play".

    JiuMengD

    Yes, localization & RTL are not very good friends !
    My solution was to embed BBcode inside translation so you have something like:

    KEYONE=[center]Title[/center],[center]Titre[/center]

    for instance in en and fr.

    For long texts, I even create a little function to load a custom text file with marks to identify language and various pages.

      JusTiCe8

      kuligs2

      Hey, hello everyone! I have found the solution! In Godot4, I can use the tr() function to mark the language that I want to localize. For example: label.text = "[ center]" + tr("KEY_PLAY") + "[/center]", and in this way, it can be displayed correctly. Hope this can also help you!