Locale Override

You can override the locale for a specific translation without changing the global CurrentLocale.

Using .Locale()

// Override with Locale enum
string korean = "menu.title".Tr("UI").Locale(Locale.KoKR);
string japanese = "menu.title".Tr("UI").Locale(Locale.JaJP);

// Override with IETF tag string
string chinese = "menu.title".Tr("UI").Locale("zh-CN");

Use Cases

Multi-language Display

Show the same content in different languages simultaneously:

public class LanguageComparisonUI : MonoBehaviour
{
    public TextMeshProUGUI englishText;
    public TextMeshProUGUI koreanText;
    public TextMeshProUGUI japaneseText;

    void UpdateText(string key)
    {
        englishText.text = key.Tr("UI").Locale(Locale.EnUS);
        koreanText.text = key.Tr("UI").Locale(Locale.KoKR);
        japaneseText.text = key.Tr("UI").Locale(Locale.JaJP);
    }
}

Language Preview

Preview translations before applying:

Per-User Locale

In multiplayer, show each user's preferred language:

Global vs Override

Chaining

Locale override can be chained with other methods:

IETF Language Tags

You can use standard IETF language tags:

Performance

Locale override does NOT cache separately per locale. Each call resolves using the specified locale.

Last updated