Which Godot translation method to use

I was reading up on adding localization to a Godot game, because it’d be nice even for English to store really long pieces of text somewhere else than the Godot scene files.

There are two main approaches csv and gettext. The CSV method seems to be the simpler of the two, requiring just a CSV file where all the translations are put into. However, that’s also a limitation as PRs doing different translations would cause merge conflict hell and probably limit how well fans could make translations.

gettext is different in that it has one file per translation so no conflicts like that, but to properly generate the files and update translations you need to install the gettext tools (though there seem to also be online translation services that support gettext). One additional future benefit with this approach is that it would be possible to write a script that automatically extracts all the translatable strings from the game, though that might be a bit hard to make for C# source code.

There is already at least one in-progress translation that uses the csv method:

Though it seems to be on-pause currently (at least on Github).

So I think we should go for the gettext style translations, making the automated tool for creating the translation template can be left for later.

2 Likes

Seeing as no one objected I opened an issue:

I’m definitely in favor of gettext.

I’ll try to look into that (and the related issue about spacing) this evening.

2 Likes

One thing that I found out which might help you is that in C# it seems that you need to use Godot’s TranslationServer directly to get translations (that are needed in C# code). Instead of the tr or Tr method that’s available in gdscript.

Woops forgot to read this thread earlier, but yeah I would also be in favour of gettext. It seems like it would be more work up front but pay off long term by making translations easier.

2 Likes