flutter_locales는 여러 언어를 쉽게 지원함으로써 앱의 로컬라이제이션을 단순화하는 Flutter 패키지입니다. 번역 관리, 동적으로 로케일 전환, 언어별 형식 처리를 위한 간단한 방법을 제공합니다. Flutter의 국제화 시스템과 원활하게 통합되어 개발자가 번역 파일을 정의하고 간단한 키를 통해 로컬라이즈된 문자열에 접근할 수 있도록 합니다. Android, iOS, Web, macOS, Windows, Linux 등 모든 주요 플랫폼을 지원하여 다국어 기능이 필요한 크로스플랫폼 앱에 이상적입니다.
사용 사례
다국어 앱 지원
동적 언어 전환
번역 파일 관리
크로스 플랫폼 로컬라이제이션
사용자 선호 기반 언어 선택
주요 기능
간단한 번역 키 시스템
런타임 로케일 전환
복수형 지원
Flutter의 i18n과의 통합
플랫폼에 관계없는 설계
적합한 대상
글로벌 모바일 및 웹 앱
다양한 사용자 기반을 겨냥한 앱
로컬라이제이션에 처음 도전하는 개발자
빠른 i18n 설정이 필요한 프로젝트
자주 언어가 업데이트되는 앱
고려 사항
수동 번역 파일 생성이 필요합니다
제한된 내장 번역 도구
자동 문자열 추출 없음
외부 번역 서비스와 가장 잘 어울림
올바른 파일 구조 준수에 따라 달라짐
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
flutter_locales
Localize your Flutter app to multiple locales within seconds
Why Flutter Locales
✅ Easily Localize your app
✅ Change App Locale within the app
✅ Get Last Changed locale on App starts
✅ Save Locale Language After changed buy LocaleNotifier
✅ Get Translation with LocaleText('key') Widget
voidmain() async {
WidgetsFlutterBinding.ensureInitialized();
awaitLocales.init(['en', 'fa', 'ps']); // get last saved language// remove await if you want to get app default languagerunApp(MyApp());
}
['en', 'fa', 'ps'] are language codes of .json files located in located in assets/locales folder
You can replace these languages with your languages
Wrap your MaterialApp with LocaleBuilder then provide locale to app
This project is a starting point for a Dart
package,
a library module containing code that can be shared easily across
multiple Flutter or Dart projects.
For help getting started with Flutter, view our
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full API reference.