October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Godot Localization: Keep Variable Placeholders Intact

Keep placeholders in Godot’s translatable source strings, format only after lookup, and use extraction checks and pseudolocalization to catch failures early.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep placeholders in the source string passed to tr(), then format the translated result. That lets Godot find the catalog entry and gives translators room to move named values into natural word order. The same workflow applies to extraction, template updates, and testing layouts before translations are complete.

Translate the template first, then insert runtime values

Godot’s internationalization guide recommends translating a string that still contains its formatting placeholders, then formatting the returned translation. For example:

As an Amazon Associate I earn from qualifying purchases.

message.text = tr("{character} picked up the {weapon}").format({character = "Ogre", weapon = "Sword"})

The lookup receives the stable source message, {character} picked up the {weapon}. Godot can match that string in the translation catalog; .format() then inserts the runtime values into the translated version. If you insert values before calling tr(), the resulting text may not match the catalog entry. Godot’s documentation on localization macros likewise says substitution should happen after translation lookup. Godot Engine: Internationalizing games

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prefer named placeholders when word order can change

Named placeholders identify each value by meaning, so a translator can move both values and their positions to suit the target language. Godot’s guide recommends using named placeholders with String.format() whenever possible for this reason. Positional placeholders such as %s can move to different locations in a sentence, but their order cannot change. Use clear, stable names, and provide translator comments or context when an identifier could be misunderstood.

Make sure Godot extracts the strings you need

In a gettext workflow, set the project’s scene and GDScript paths in the editor’s translation-template generation settings, then generate a POT template. Godot’s extractor recognizes common calls such as tr() and tr_n(), selected text properties and UI methods in scenes and scripts, and file-dialog filters. It requires a constant string argument or right-hand expression; a dynamically assembled expression may not be extracted. Check the generated POT to verify that the expected messages are present rather than assuming every expression will be discovered. Godot Engine: Localization using gettext

  • Regenerate the POT whenever localizable source strings or relevant scenes and scripts change.
  • Create one PO file per locale from the template, then merge later template updates into those files with gettext tooling or a compatible editor or platform.
  • Add translator comments where context is needed. Use recognized NO_TRANSLATE comments for strings that should be excluded.
  • Keep PO source files in version control, even if you use compiled MO files at runtime.

After msgmerge, changed source strings are marked fuzzy. Godot skips fuzzy entries until they have been reviewed and the fuzzy marker removed. A merge is therefore not the same as approving a translation: include review of changed entries in the update process. The Godot 4.4 guide says MO files may be worth considering for projects with several thousand strings or more, but that is guidance, not a universal performance threshold. Godot 4.4: Localization using gettext

Choose CSV or gettext for your team’s workflow

Godot supports CSV translations and gettext PO/MO files; neither format is universally safer for placeholders. Choose based on how your team edits, reviews, and maintains translations. The comparison below reflects Godot’s documentation; check the documentation for your exact engine version because the latest documentation branch can include features not present in a released stable version. Godot Engine: Localization using gettext Godot 4.4: Localization using gettext

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Consideration CSV Gettext PO/MO
Editing and collaboration Supported by Godot; fit depends on the tools your translators already use. Standard text format with per-locale files; works well with version control and gettext-compatible tools.
Version-control review Supported; the documentation does not state a universal review advantage. Per-locale text files support Git review and merging.
Multiline strings The documentation does not identify a comparative advantage. Godot’s documentation describes PO as better suited to multiline strings.
Contexts and plurals The documentation does not identify equivalent capabilities in its comparison. Contexts and pluralization are supported through Godot’s extraction workflow.
Maintenance Choose tools that fit your team’s existing process. More complex format; maintenance uses gettext command-line tools or compatible editors and platforms.
Compiled runtime files No comparable compiled format is specified in the cited documentation. MO files can be used at runtime; Godot 4.4 suggests considering them for projects with several thousand strings or more.

PO/MO support has been available since Godot 4.0, according to the Godot 4.4 documentation. Confirm available features and editor labels in the documentation for the version your project actually uses.

Use pseudolocalization to catch extraction and layout problems

Godot can pseudolocalize text in project settings or at runtime. Its options include accenting characters, simulating text expansion, adding a prefix and suffix, faking bidirectional text, and skipping formatting placeholders. Pseudolocalized output keeps placeholders as-is, which helps check that formatting tokens survive the translation path. Godot Engine: Internationalization Godot Engine: Pseudolocalization

Use the test to find strings that were missed and controls that cannot accommodate longer text. Godot’s pseudolocalization guide gives an expansion ratio of 0.3 as an example setting that increases text length by 30%; treat it as a configuration example, not a prediction of how much a real translation will expand.

Pseudolocalization is an early structural check, not a replacement for review in real languages. Godot warns that readable pseudo output is not an effective font-coverage test for Chinese, Japanese, Korean, or right-to-left scripts. Test with actual target-language strings and suitable fonts, and inspect the interface in each target locale.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check locale switching and right-to-left layouts

Godot recommends defaulting to the player’s preferred language, configuring a fallback when a translation is unavailable, and allowing players to change language in the game. The engine standardizes locale strings and applies loaded translations when the locale changes. Godot Engine: Internationalizing games

Godot’s UI can automatically adapt some right-to-left behavior: it can mirror left and right anchors and margins, swap text alignment, and reverse the horizontal order of controls in containers. The coordinate system itself is not mirrored, and non-UI nodes such as sprites are unaffected. Test scene composition and non-UI elements separately rather than assuming the whole scene will flip.

A practical localization update cycle

  1. Write extractable source strings. Keep each translatable template as a constant string, with named placeholders for runtime values that may need reordering.
  2. Generate the POT. Configure the relevant scene and script paths in the editor’s template-generation settings and inspect the output for expected messages.
  3. Update locale files. Merge the new template into each PO file, then review changed or fuzzy entries before removing their fuzzy markers.
  4. Run pseudolocalization. Check that messages appear, placeholders remain intact, and controls tolerate simulated expansion and bidirectional text.
  5. Review actual target locales. Verify wording, fonts, layout, and right-to-left scene behavior with real strings and the engine version you ship.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.