Localization with tr() is just giving back the key

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Darxoon

I have a translation file that looks like this:

I imported it successfully and also added the .translation files in the project settings. However, when I make a label and call that ACTION_JUMP_DEFAULT or call tr("ACTION_JUMP_DEFAULT"), it will just display “ACTION_JUMP_DEFAULT” instead of the translation

I really have no idea how to fix this

:bust_in_silhouette: Reply From: JimArtificer

Your game’s locale may be set to something other than en or de.

Also, confirm that Project Settings > General > Rendering > Locale > Fallback is set to en.

How do I change the game’s locale in the editor?

Darxoon | 2020-06-22 17:02

The game’s locale, if it’s set from the godot project launcher, is set to en and the fallback is at en too

Darxoon | 2020-06-22 17:13

You can force a specific language using the command-line argument --language. For instance, in your project folder, run:

path\to\godot.exe --language de

Calinou | 2020-06-29 13:14

That doesn’t work either, it just gives back the key
Also, I really don’t know what’s wrong with the csv

Translation table
Here’s an ingame screenshot:

Ingame screenshot

Darxoon | 2020-06-29 19:49

:bust_in_silhouette: Reply From: Grxxney

I hope I can help you and some other people with my solution:

I had the same problem but since I changed the character set in my .csv file to “Unicode (UTF-8)” it fixed it for me.

Hopefully it’s also working for other people which also have this problem!