Up to date
This page is up to date for Godot
If you still find outdated information, please open an issue.
Localization using gettext¶
In addition to Importing translations in CSV format, Godot
also supports loading translation files written in the GNU gettext
.po and compiled
.mo since Godot 4.0).
For an introduction to gettext, check out
A Quick Gettext Tutorial.
It's written with C projects in mind, but much of the advice
also applies to Godot (with the exception of
gettext is a standard format, which can be edited using any text editor or GUI editors such as Poedit.
Compared to CSV, gettext works better with version control systems like Git, as each locale has its own messages file.
Multiline strings are more convenient to edit in gettext files compared to CSV files.
gettext is a more complex format than CSV and can be harder to grasp for people new to software localization.
People who maintain localization files will have to install gettext tools on their system. However, as Godot supports using text-based message files (
.po), translators can test their work without having to install gettext tools.
Installing gettext tools¶
The command line gettext tools are required to perform maintenance operations, such as updating message files. Therefore, it's strongly recommended to install them.
Windows: Download an installer from this page. Any architecture and binary type (shared or static) works; if in doubt, choose the 64-bit static installer.
Linux: On most distributions, install the
gettextpackage from your distribution's package manager.
Creating the PO template¶
Automatic generation using the editor¶
Since Godot 4.0, the editor can generate a PO template automatically from
specified scene and script files. This POT generation also supports translation
contexts and pluralization if used in a script, with the optional second
tr() and the
Open the Project Settings' Localization > POT Generation tab, then use the Add… button to specify the path to your project's scenes and scripts that contain localizable strings:
After adding at least one scene or script, click Generate POT in the to