From 054575097b1f17576b7c926fac9554bd49d6d3e8 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Tue, 29 Aug 2023 14:30:01 +0800 Subject: [PATCH] Update i18n text, disable warning --- analysis_options.yaml | 2 ++ lib/l10n/app_en.arb | 4 +++- lib/l10n/app_zh.arb | 6 ++++-- lib/main.dart | 1 - lib/set_server.dart | 13 +++++++------ 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 917bebe..4c81365 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,3 +2,5 @@ include: package:flutter_lints/flutter.yaml analyzer: exclude: - "**/*.g.dart" + errors: + unnecessary_non_null_assertion: ignore diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index d623046..c298e75 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -1,3 +1,5 @@ { - "title": "E-Hentai Downloader Dashboard" + "title": "E-Hentai Downloader Dashboard", + "serverHost": "EH Downloader Server Host", + "apiPath": "API Path" } diff --git a/lib/l10n/app_zh.arb b/lib/l10n/app_zh.arb index d79a9d0..f13e927 100644 --- a/lib/l10n/app_zh.arb +++ b/lib/l10n/app_zh.arb @@ -1,3 +1,5 @@ { - "title": "E-Hentai 下载器面板" -} \ No newline at end of file + "title": "E-Hentai 下载器面板", + "serverHost": "EH Downloader 服务器主机", + "apiPath": "API 路径" +} diff --git a/lib/main.dart b/lib/main.dart index b5ff4bd..cf84440 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,7 +27,6 @@ void main() async { if (isDesktop) { WidgetsFlutterBinding.ensureInitialized(); await windowManager.ensureInitialized(); - await windowManager.setTitle("E-Hentai Downloader Dashboard"); } runApp(const MainApp()); } diff --git a/lib/set_server.dart b/lib/set_server.dart index 3e2ee3c..74ee6ad 100644 --- a/lib/set_server.dart +++ b/lib/set_server.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:go_router/go_router.dart'; import 'globals.dart'; @@ -71,9 +72,9 @@ class _SetServerPageState extends State { Container( padding: const EdgeInsets.symmetric(vertical: 8), child: TextFormField( - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'EH Downloader Server URL', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: AppLocalizations.of(context)!.serverHost, ), initialValue: _serverUrl, onChanged: _serverUrlChanged, @@ -81,9 +82,9 @@ class _SetServerPageState extends State { Container( padding: const EdgeInsets.symmetric(vertical: 8), child: TextFormField( - decoration: const InputDecoration( - border: OutlineInputBorder(), - labelText: 'API Path', + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: AppLocalizations.of(context)!.apiPath, ), initialValue: _apiPath, onChanged: _apiPathChanged,