skillfed

localization

Master multi-language game development by wrapping user-facing strings with tr(), organizing translations in CSV or PO files, and switching locales at runtime through TranslationServer. This skill covers semantic key strategies, automatic Control node translation, pluralization handling, and right-to-left text support for global audiences.

Localization in Godot 4.3+ enables multi-language support through translation files, the tr() function, and runtime locale switching via TranslationServer.

AI-generated summary based on this skill's SKILL.md

487 27 MIT updated by jame581

Install

jame581/GodotPrompter/localization · repository language: JavaScript

CLI (skillfed)coming soon
git clone https://github.com/jame581/GodotPrompter
cp -r GodotPrompter/skills/localization ~/.claude/skills/localization

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I add multiple languages to a Godot game?

Localization in Godot starts by wrapping user-facing strings with the tr() function, then organizing translations in CSV or PO files. Use TranslationServer to load translation resources and switch locales at runtime. Create a translation file for each language, import it as a Translation resource, and add it to the project's localization settings. Godot automatically handles Control node translation when auto_translate_mode is enabled.

What is the godot translation server set locale workflow?

Localization's TranslationServer manages runtime locale switching. Call TranslationServer.set_locale(locale_code) to change the active language—for example, set_locale("es") for Spanish or set_locale("ar") for Arabic. Load your translation resources via TranslationServer.add_translation(translation_resource) before switching. When you change the locale, all tr() calls automatically return strings in the new language, and Control nodes with auto_translate_mode enabled refresh their text.

How do I set up RTL support in Godot for Arabic and Hebrew?

Localization supports right-to-left text through font configuration and layout settings. Assign RTL-compatible fonts (with proper Arabic or Hebrew glyphs) to your Control nodes. Use TextServer's text direction detection or explicitly set text_direction to TextServer.DIRECTION_RTL. For mixed-direction content, RichTextLabel handles bidirectional text automatically. Ensure your translation files contain properly shaped RTL text, and test in the editor preview with locale set to your target RTL language.

How should I handle pluralization and locale-aware formatting?

Localization provides tr_n(singular_key, plural_key, count) for plural forms—pass the count to select the correct form. For locale-aware number and date formatting, use OS.get_locale_language() to detect the current language, then apply region-specific formatting rules (e.g., comma vs. period for decimals). Store formatting patterns in your translation files or use helper functions that adapt based on TranslationServer.get_locale(). This ensures dates, currency, and numbers display correctly for each language.

What's the best practice for translation key naming conventions?

Localization recommends semantic, hierarchical key names that describe content rather than location—use keys like "menu_start_button" or "dialog_confirm_message" instead of "button_1" or "text_5". Group related strings with prefixes ("ui_", "dialog_", "error_") for organization. Use lowercase with underscores, keep keys concise, and add context comments in CSV/PO files for translator clarity. This approach scales better and makes maintenance easier as your game grows.

Why aren't my translation keys displaying or updating on locale change?

Localization issues often stem from: translation resources not added to TranslationServer, tr() calls wrapping only some strings inconsistently, or auto_translate_mode disabled on Control nodes. Verify your CSV/PO files are imported as Translation resources and loaded before locale switches. Check that all user-facing text uses tr(key) or tr_n() calls. If text still doesn't update, ensure the locale code matches your translation file's language tag exactly (e.g., "en" vs. "en_US").

SKILL.md

rendered from the published skill — quoted content, verbatim

Localization in Godot 4.3+

All examples target Godot 4.3+ with no deprecated APIs; GDScript first, then C#.

> Related skills: godot-ui for Control nodes and theme management, save-load for persisting language settings, responsive-ui for layout adjustments per locale.


1. Core Concepts

How Godot Localization Works
  1. Wrap all user-facing strings in tr() — Godot's translation function
  2. Create translation files (CSV or PO) mapping keys to translated strings
  3. Import translation files as Translation resources
  4. Switch locale at runtime via TranslationServer.set_locale()

All Control nodes with text, tooltip_text, or placeholder_text properties auto-translate when the value matches a translation key.

Translation Key Strategies
Strategy Example Key Pros Cons
Semantic keys MENU_START_GAME Clear intent, easy to find Needs a default language fallback

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 2 files
skills/localization/SKILL.md
skills/localization/references/csv-plural-context.md

Related skills

Tags

multi-language-support string-externalization right-to-left-text plural-handling locale-switching character-encoding translation-workflow ui-adaptation editor-preview context-disambiguation