Flutter 애플리케이션에서 국제화 구현을 간소화하기 위해 설계된 플러터 패키지입니다. 다양한 언어로 번역을 체계적으로 관리할 수 있는 접근 방식을 제공하여 개발자가 지역 설정 간 전환을 쉽게 하고 다양한 사용자 기반을 지원할 수 있도록 합니다. 플러터의 로컬라이제이션 시스템과 원활하게 통합되며, 안드로이드, iOS, 웹, macOS, 윈도우, 리눅스 등 모든 주요 플랫폼을 지원합니다. 명확한 구성과 확장 가능한 번역 관리를 통해 다국어 앱 개발 과정을 간소화합니다.
사용 사례
다국어 모바일 및 웹 앱 개발
글로벌 사용자 대상 지원
동적 언어 전환 관리
기존 번역 워크플로우와의 통합
로케일 인식 UI 개발 간소화
주요 기능
간편한 번역 파일 관리
내장된 로케일 전환
크로스 플랫폼 호환성
확장 가능한 번역 구조
Flutter의 로컬라이제이션 API와의 원활한 통합
적합한 대상
국제 시장을 겨냥하는 개발자
다중 언어 지원이 필요한 앱
외부 번역 서비스를 사용하는 팀
자주 로컬라이제이션 업데이트가 있는 프로젝트
고려 사항
번역 파일 설정이 필요합니다
일관된 키 이름에 따라 달라짐
번역 워크플로우를 위해 추가 도구가 필요할 수 있습니다
실시간 번역에 적합하지 않습니다
제한된 내장 번역 편집 도구
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
internationalization
A Flutter package that makes adding multi-language support to your app simple and flexible — no code generation required.
Features
✅ Load translations from local JSON asset files
✅ Inject translations at runtime from any external source (API, database, etc.)
✅ Nested keys — navigate deep JSON structures with parent or dot notation
✅ String interpolation with positional ({0}, {1}) and named (::key::) arguments
✅ Plural support — zero, one, other forms
✅ Extension methods on String and BuildContext for ergonomic usage
✅ TextIntl widget — a drop-in replacement for Text that auto-translates
✅ Re-exports NumberFormat and DateFormat from the intl package
Create one JSON file per language inside your assets folder. The default path is assets/translations/. Files must be named after the language code (e.g. en.json, pt.json).
Note: If your translations span multiple files per locale, list every file individually or use a directory entry (e.g. assets/translations/en/). The path must match exactly what you pass to translationsPath.
2. MaterialApp configuration
import'package:flutter_localizations/flutter_localizations.dart';
import'package:internationalization/internationalization.dart';
const _supportedLocales = [
Locale('en'),
Locale('pt'),
Locale('es'),
];
MaterialApp(
supportedLocales: _supportedLocales,
localizationsDelegates: [
InternationalizationDelegate(
suportedLocales: _supportedLocales,
// Default path is 'assets/translations/' — only override if needed.
translationsPath: 'assets/translations/',
// Optional: merge translations fetched at runtime (API, remote config, etc.)
addTranslations: (locale) async {
return {
'remote_key': 'Value from the network for ${locale.languageCode}',
};
},
),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
);
InternationalizationDelegate parameters
Parameter
Type
Required
Default
Description
suportedLocales
List<Locale>
✅
—
Locales the app supports
translationsPath
String
'assets/translations/'
Path to the JSON files directory
addTranslations
Future<Map<String, dynamic>> Function(Locale)?
null
Callback to inject extra translations at load time
JSON structure
Translations are plain JSON objects. Keys can be flat or deeply nested:
TextIntl accepts all the same parameters as Text (style, textAlign, overflow, maxLines, etc.) plus the translation parameters parent, args, namedArgs, and pluralValue.
Interpolation
Positional arguments — {0}, {1}, …
JSON:
{"welcome_message":"Hello, {0}! You have {1} new messages."}
Dart:
context.translate(
'welcome_message',
args: ['Alice', '5'],
);
// → "Hello, Alice! You have 5 new messages."
{"order_ready":"Dear ::name::, your order #{0} is ready."}
Dart:
context.translate(
'order_ready',
args: ['42'],
namedArgs: {'name': 'Maria'},
);
// → "Dear Maria, your order #42 is ready."
Plurals
Define a zero, one, and other form for any key:
JSON:
{"cart":{"items":{"zero":"Your cart is empty.","one":"You have {0} item in your cart.","other":"You have {0} items in your cart."}}}
Dart:
// zero
context.translate('items', parent: ['cart'], pluralValue: 0, args: ['0']);
// → "Your cart is empty."// one
context.translate('items', parent: ['cart'], pluralValue: 1, args: ['1']);
// → "You have 1 item in your cart."// other
context.translate('items', parent: ['cart'], pluralValue: 42, args: ['42']);
// → "You have 42 items in your cart."
Plural forms can also be combined with named args:
Injected keys follow the same JSON structure and can be accessed with context.translate, the String extension, or TextIntl exactly like local keys.
Example
A full showcase example demonstrating every feature is available in the example/ directory. It covers simple strings, nested keys, interpolation, plurals, runtime injection, and NumberFormat/DateFormat — with a live language switcher between English, Portuguese, and Spanish.
cd example
flutter run
API reference
Translator
Method
Description
Translator.of(context)
Returns the Translator instance for the current locale