Godot Version
4
Question
The title says it all. I’ve looked into the documentation (Internationalizing games — Godot Engine (stable) documentation in English) but there’s no code samples for C#.
I’ve imported a spreadsheet with a simple language string:
keys,en
engineer_encounter_1_1,Hello traveler
I’ve tried instantiating a Translation object and using the GetMessage() method, but to no avail. Running out of ideas at this point.
public partial class DialogEngineerFirstEncounter
{
private readonly Translation _translation = new();
public DialogEngineerFirstEncounter()
{
TranslationServer.SetLocale("en");
}
public List<DialogItem> GetDialogItems()
{
return new() {
new DialogItem() {
Type = "speech",
Text = _translation.GetMessage("engineer_encounter_1_1"),
},
};
}
}