chore: prepare for l10n
This commit is contained in:
3
l10n.yaml
Normal file
3
l10n.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
arb-dir: lib/l10n
|
||||||
|
template-arb-file: app_en.arb
|
||||||
|
output-localization-file: app_localizations.dart
|
3
lib/l10n/app_en.arb
Normal file
3
lib/l10n/app_en.arb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"helloWorld": "Hello World!"
|
||||||
|
}
|
3
lib/l10n/app_zh.arb
Normal file
3
lib/l10n/app_zh.arb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"helloWorld": "你好世界!"
|
||||||
|
}
|
@@ -5,6 +5,7 @@ import 'package:window_manager/window_manager.dart';
|
|||||||
import 'package:winui_n2n/application_exit_control.dart';
|
import 'package:winui_n2n/application_exit_control.dart';
|
||||||
import 'package:winui_n2n/edge_state.dart';
|
import 'package:winui_n2n/edge_state.dart';
|
||||||
import 'package:winui_n2n/shared_pref_singleton.dart';
|
import 'package:winui_n2n/shared_pref_singleton.dart';
|
||||||
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@@ -50,6 +51,8 @@ class _MainAppState extends State<MainApp> {
|
|||||||
theme: ThemeData(),
|
theme: ThemeData(),
|
||||||
darkTheme: ThemeData.dark(),
|
darkTheme: ThemeData.dark(),
|
||||||
themeMode: _themeMode,
|
themeMode: _themeMode,
|
||||||
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||||
|
supportedLocales: AppLocalizations.supportedLocales,
|
||||||
home: const Scaffold(
|
home: const Scaffold(
|
||||||
body: ApplicationExitControl(),
|
body: ApplicationExitControl(),
|
||||||
),
|
),
|
||||||
|
@@ -23,3 +23,4 @@ dev_dependencies:
|
|||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
generate: true
|
||||||
|
Reference in New Issue
Block a user