Unreal Engine 현지화 완벽 가이드
FText 매크로부터 로케일 폴백 체인까지, Localization Dashboard, String Table, C++, Blueprint, 자동 번역으로 UE5 게임을 현지화하는 방법을 알아보세요.
FText와 현지화 파이프라인
FText는 Unreal Engine에서 현지화를 지원하는 문자열 형식이에요. UI 레이블, 대화, 도구 설명, 알림처럼 게임에서 사용자에게 보이는 모든 문자열은 현지화 파이프라인에 포함되도록 FText를 사용해야 해요. FString은 내부 로직에만 사용하세요.
// FText is UE's localization-aware string type.
// ALWAYS use FText for user-facing text, never FString.
// LOCTEXT: localize a literal string (most common)
FText Title = LOCTEXT("MainMenuTitle", "Start Game");
// NSLOCTEXT: specify namespace explicitly
FText Msg = NSLOCTEXT("UI", "WelcomeMessage", "Welcome, adventurer!");
// INVTEXT: invariant text (never translated — debug/logging only)
FText Debug = INVTEXT("Debug overlay active");
// FText::Format: safe variable interpolation
FText Greeting = FText::Format(
LOCTEXT("PlayerGreeting", "Hello, {PlayerName}!"),
FText::FromString(PlayerName)
);// In a UMG Widget (C++)
void UMainMenuWidget::NativeConstruct()
{
Super::NativeConstruct();
// Bind localized text to UI elements
if (TitleLabel)
{
TitleLabel->SetText(LOCTEXT("GameTitle", "My Epic Game"));
}
if (PlayButton)
{
PlayButton->SetText(LOCTEXT("PlayButtonLabel", "Play Now"));
}
}
// IMPORTANT: Always use LOCTEXT for UMG widget text.
// Setting text via FString bypasses the localization pipeline.Localization Dashboard 설정
Localization Dashboard는 번역을 관리하는 UE 내장 도구예요. 소스 코드의 모든 LOCTEXT 및 NSLOCTEXT 문자열을 수집하고 번역용 .po 파일로 내보낸 다음, UE가 런타임에 로드하는 .locres 바이너리 파일로 컴파일해요.
# 1. Open the Localization Dashboard:
# Window > Localization Dashboard
# 2. Add a localization target (e.g., "Game")
# 3. Add cultures:
# Click "Add New Culture" > select languages (de, ja, fr, es, ko, zh-Hans...)
# 4. Gather text:
# Click "Gather Text" — UE scans all LOCTEXT/NSLOCTEXT macros
# 5. Export translations:
# Click "Export" to generate .po files for each culture
# 6. Import translations:
# After translating .po files, click "Import"
# 7. Compile translations:
# Click "Compile" to generate .locres binary files
# 8. Preview:
# Editor Preferences > Region & Language > Preview Game Language데이터 기반 텍스트용 String Table
String Table을 사용하면 소스 파일 곳곳에 LOCTEXT 매크로를 두는 대신 현지화 문자열을 중앙 집중식 애셋에 정의할 수 있어요. UI 텍스트, 대화, 디자이너나 작가가 코드를 건드리지 않고 편집해야 하는 문자열에 적합해요. String Table은 UE 애셋으로 정의하거나 CSV에서 가져올 수 있어요.
// StringTables provide a data-driven approach to localization.
// Define strings in a CSV asset instead of scattering LOCTEXT across code.
// 1. Create a String Table asset:
// Content Browser > Right-click > Miscellaneous > String Table
// 2. Or define via CSV (importable into UE):
// Key,SourceString
// MainMenu_Title,Start Game
// MainMenu_Continue,Continue
// MainMenu_Settings,Settings
// MainMenu_Quit,Quit to Desktop
// HUD_Health,Health
// HUD_Ammo,Ammo: {0}
// Dialog_Merchant_Greeting,Welcome to my shop!
// 3. Reference in C++:
FText Title = FText::FromStringTable(
FName(TEXT("/Game/Localization/ST_MainMenu")),
TEXT("MainMenu_Title")
);
// 4. Reference in Blueprints:
// Use the "Make Text from String Table" node
// Set Table ID and KeyC++ 현지화 패턴
C++에서는 각 .cpp 파일 위쪽에 LOCTEXT_NAMESPACE를 정의하고 사용자에게 보이는 모든 문자열에 LOCTEXT를 사용하세요. 변수가 있는 동적 콘텐츠에는 FText::Format을 사용하세요. 네임스페이스가 누출되지 않도록 파일 끝에서 항상 정의를 해제하세요.
// Define a namespace at the top of each .cpp file
// All LOCTEXT calls in this file use this namespace
#define LOCTEXT_NAMESPACE "MyGame.MainMenu"
#include "MainMenuWidget.h"
void UMainMenuWidget::NativeConstruct()
{
Super::NativeConstruct();
// These use the "MyGame.MainMenu" namespace automatically
TitleText->SetText(LOCTEXT("Title", "Main Menu"));
PlayText->SetText(LOCTEXT("PlayButton", "Play"));
SettingsText->SetText(LOCTEXT("SettingsButton", "Settings"));
QuitText->SetText(LOCTEXT("QuitButton", "Quit"));
}
// CRITICAL: Always undefine at the end of the file
#undef LOCTEXT_NAMESPACE// FText::Format — the safe way to build localized strings
// NEVER use FString::Printf or string concatenation for user-facing text.
// Named arguments (recommended)
FText ItemPickup = FText::Format(
LOCTEXT("ItemPickup", "You picked up {ItemName} x{Count}"),
FText::FromString(ItemName),
FText::AsNumber(Count)
);
// FText::AsNumber respects locale formatting:
// English: 1,234,567
// German: 1.234.567
// French: 1 234 567
// FText::AsCurrency for prices:
FText Price = FText::AsCurrency(
9.99,
TEXT("USD"),
&FInternationalization::Get().GetCurrentCulture().Get()
);
// FText::AsDate and FText::AsTime for dates:
FText DateStr = FText::AsDate(FDateTime::Now());Blueprint 현지화
Blueprint의 모든 Text 속성은 기본적으로 FText이므로 이미 현지화할 준비가 되어 있어요. 문자열을 수집할 수 있도록 속성 세부 정보 패널에서 Key와 Namespace를 설정하세요. 변수가 있는 동적 콘텐츠에는 Format Text 노드를 사용하세요.
// Blueprint Localization Basics:
//
// 1. All Text properties in Blueprints are FText by default
// (already localization-ready)
//
// 2. Set the Text property in the Details panel
// Expand the dropdown to set:
// - Key: unique identifier for translation
// - Namespace: grouping for organization
// - Source String: the text to display/translate
//
// 3. For dynamic text, use the "Format Text" node:
// Format: "Hello, {PlayerName}!"
// Connect a "Find" pin named "PlayerName" to your variable
//
// 4. For plurals, use "Text Format with Arguments":
// Pattern: "{Count}|plural(one=item,other=items)"
//
// 5. Culture switching at runtime:
// Use "Set Current Culture" node
// Input: culture code string (e.g., "de", "ja", "fr")복수형과 성별 처리
Unreal Engine은 복수형과 성별에 따른 텍스트를 위한 ICU 메시지 형식을 지원해요. 원본 문자열에 복수형 규칙을 정의하면 UE가 활성 문화권의 CLDR 규칙에 따라 올바른 형식을 자동으로 선택해요.
// UE uses ICU message format for plurals.
// Define plural rules in your .po or String Table:
// English source:
// "{Count}|plural(one=You have # item,other=You have # items)"
// German translation:
// "{Count}|plural(one=Du hast # Gegenstand,other=Du hast # Gegenstaende)"
// Arabic translation (6 forms):
// "{Count}|plural(zero=لا عناصر,one=عنصر واحد,two=عنصران,few=# عناصر,many=# عنصرًا,other=# عنصر)"
// Japanese (1 form):
// "{Count}|plural(other=アイテム#個)"
// In C++:
FText ItemCount = FText::Format(
LOCTEXT("ItemCount",
"{Count}|plural(one=You have {Count} item,other=You have {Count} items)"),
ItemCount
);
// Gender-dependent text:
// "{Gender}|gender(masculine=Il est,feminine=Elle est) prêt{Gender}|gender(masculine=,feminine=e)"현지화 패키징 및 테스트
출시하기 전에 모든 대상 문화권에 컴파일된 .locres 파일이 있고 텍스트가 런타임에 올바르게 렌더링되는지 확인하세요. 편집기의 문화권 미리 보기, 명령줄 문화권 재정의, 자동 검사를 사용해 누락되거나 손상된 번역을 찾아내세요.
# Compile and test localization before packaging:
# 1. Editor Preferences > Region & Language > Preview Game Language
# Set to each target language and verify all text renders correctly.
# 2. Command-line culture override for testing:
MyGame.exe -culture=ja
# 3. Packaging settings:
# Project Settings > Packaging > Localizations to Package
# Select all cultures you want to include in the build.
# 4. Verify .locres files exist after packaging:
MyGame/Content/Localization/Game/
├── en/
│ └── Game.locres
├── de/
│ └── Game.locres
├── ja/
│ └── Game.locres
├── fr/
│ └── Game.locres
└── ko/
└── Game.locres
# 5. Runtime culture switching:
# FInternationalization::Get().SetCurrentCulture(TEXT("ja"));
# This reloads all FText strings from the new culture's .locres files.로케일 폴백 체인 추가
Unreal Engine의 기본 현지화는 IETF 하위 태그 계층을 따라서만 대체해요. pt-BR 사용자는 번역이 누락되면 사용 가능한 pt-PT 번역 대신 영어를 보게 돼요. locale-chain-ue는 FTextLocalizationManager를 통해 설정 가능한 지역 변형 간 폴백 체인을 추가하여 지역 사용자가 가장 가까운 번역을 볼 수 있게 해요.
// locale-chain-ue: Smart fallback chains for UE5
// Problem: UE falls back to default when a locale is missing.
// pt-BR user gets English instead of pt-PT translations.
// Solution: One function call at startup.
#include "LocaleChain.h"
void UMyGameInstance::Init()
{
Super::Init();
ULocaleChain::Configure(); // Load 75 built-in fallback chains
}
// Now resolve strings with per-key fallback:
FString Greeting = ULocaleChain::Resolve(
TEXT("greeting"), TEXT("MyNamespace")
);
// pt-BR user: tries pt-BR -> pt-PT -> pt -> default
// Custom overrides:
TMap<FString, FString> Overrides;
Overrides.Add(TEXT("pt-BR"), TEXT("pt")); // Simplify chain
Overrides.Add(TEXT("sv-FI"), TEXT("sv")); // Add new chain
ULocaleChain::ConfigureWithOverrides(Overrides);
// Full control (C++ only):
TMap<FString, TArray<FString>> Custom;
Custom.Add(TEXT("pt-BR"), {TEXT("pt-PT"), TEXT("pt")});
Custom.Add(TEXT("es-MX"), {TEXT("es-419"), TEXT("es")});
ULocaleChain::ConfigureCustom(Custom, false);번역 품질 자동화
흔한 실수
사용자용 텍스트에 FString 사용
누락된 #undef LOCTEXT_NAMESPACE
하드코딩된 복수형 로직
가져온 뒤 컴파일 누락
권장 프로젝트 구조
MyUnrealProject/
├── Config/
│ └── Localization/
│ └── Game.ini # Localization target config
├── Content/
│ └── Localization/
│ ├── Game/
│ │ ├── Game.manifest # Gather manifest
│ │ ├── en/
│ │ │ ├── Game.po # Source strings (.po)
│ │ │ └── Game.locres # Compiled binary
│ │ ├── de/
│ │ │ ├── Game.po
│ │ │ └── Game.locres
│ │ ├── ja/
│ │ │ ├── Game.po
│ │ │ └── Game.locres
│ │ └── fr/
│ │ ├── Game.po
│ │ └── Game.locres
│ └── StringTables/
│ ├── ST_MainMenu.uasset # String Table asset
│ └── ST_HUD.uasset
├── Plugins/
│ └── LocaleChain/ # locale-chain-ue plugin
│ ├── LocaleChain.uplugin
│ └── Source/
│ └── LocaleChain/
├── Source/
│ └── MyGame/
│ ├── UI/
│ │ ├── MainMenuWidget.h
│ │ └── MainMenuWidget.cpp # LOCTEXT macros here
│ └── MyGameInstance.cpp # ULocaleChain::Configure()
└── MyUnrealProject.uproject지금 i18n Agent 사용해 보기
번역 파일을 여기에 드롭
JSON, YAML, PO, XML, CSV, Markdown, Properties
또는 클릭하여 파일 선택
대상 언어