From 103b1dffe20835e97cf5f944657bc62cc5135172 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 21 Jul 2021 15:42:37 +0800 Subject: [PATCH] support internationalization --- l10n.yaml | 4 ++++ lib/l10n/app_zh.arb | 10 ++++++++++ pubspec.lock | 2 +- pubspec.yaml | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 l10n.yaml create mode 100644 lib/l10n/app_zh.arb diff --git a/l10n.yaml b/l10n.yaml new file mode 100644 index 0000000..dff1749 --- /dev/null +++ b/l10n.yaml @@ -0,0 +1,4 @@ +arb-dir: lib/l10n +template-arb-file: app_zh.arb +output-localization-file: app_localizations.dart +output-class: S \ No newline at end of file diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb new file mode 100644 index 0000000..76a6eb9 --- /dev/null +++ b/lib/l10n/app_zh.arb @@ -0,0 +1,10 @@ +{ + "appName": "智慧社区", + "@appName":{ + "description": "应用名称" + }, + "tempPlotName": "人才公寓智慧小区", + "@tempPlotName":{ + "description": "临时使用的小区名称" + } +} \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 1e2f224..594f813 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -561,7 +561,7 @@ packages: source: hosted version: "4.5.1" intl: - dependency: transitive + dependency: "direct main" description: name: intl url: "https://pub.flutter-io.cn" diff --git a/pubspec.yaml b/pubspec.yaml index 1e22b79..2d70144 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter + intl: ^0.17.0 cupertino_icons: ^1.0.2 #屏幕适配 flutter_screenutil: ^5.0.0-nullsafety.11 @@ -99,7 +100,7 @@ flutter: - assets/static_temp/ - assets/static_fix/ - + generate: true fonts: - family: Bebas fonts: