# Which Godot translation method to use

**URL:** https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713
**Category:** Programming
**Created:** [September 2, 2020, 5:13pm UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713 "2020-09-02T17:13:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [September 2, 2020, 5:13pm UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713/1 "2020-09-02T17:13:40Z")

</div>

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](https://docs.godotengine.org/en/stable/getting_started/workflow/assets/importing_translations.html#translation-format) and [gettext](https://docs.godotengine.org/en/stable/tutorials/i18n/localization_using_gettext.html#doc-localization-using-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:

> <https://github.com/Revolutionary-Games/Thrive/pull/1359>

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.

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [September 4, 2020, 8:19am UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713/2 "2020-09-04T08:19:13Z")

</div>

Seeing as no one objected I opened an issue:

> <https://github.com/Revolutionary-Games/Thrive/issues/1579>
>
> https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713?u=hhyyrylainen
> All the GUI strings should be moved to the translation files.
> Needs: #1509

---

<div class="post-metadata">

### Author: ![Nicolas](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/nicolas/32/1477_2.png) [@Nicolas](https://forum.revolutionarygamesstudio.com/u/Nicolas)
#### Post date: [September 4, 2020, 10:32am UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713/3 "2020-09-04T10:32:14Z")

</div>

I’m definitely in favor of gettext.

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

---

<div class="post-metadata">

### Author: ![hhyyrylainen](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/hhyyrylainen/32/2243_2.png) [@hhyyrylainen](https://forum.revolutionarygamesstudio.com/u/hhyyrylainen)
#### Post date: [September 4, 2020, 10:58am UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713/4 "2020-09-04T10:58:16Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![NickTheNick](https://thrivedevforum-cdn.b-cdn.net/user_avatar/forum.revolutionarygamesstudio.com/nickthenick/32/17_2.png) [@NickTheNick](https://forum.revolutionarygamesstudio.com/u/NickTheNick)
#### Post date: [September 4, 2020, 2:11pm UTC](https://forum.revolutionarygamesstudio.com/t/which-godot-translation-method-to-use/713/5 "2020-09-04T14:11:40Z")

</div>

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.
