fix locale in get-cli standard (#81)

* refactor project in get-cli standard

* use local trackers when github is not connectable
upgrade stylish_bottom_bar to 1.0.0
responsive view for home_view
treeview for file_list_vie
fluent ui integrating

* improve responsive view.
treeView add light theme.fix overflow bugs

* responsive view,treeView,file select
downloaded and downloading pages
file extension icons
fix some minor bugs

* use local trackers when github is not connectable
upgrade stylish_bottom_bar to 1.0.0
responsive view for home_view
treeview for file_list_vie
fluent ui integrating

* improve responsive view.
treeView add light theme.fix overflow bugs

* bottom bar index fix

* refactor project in get-cli standard

---------

Co-authored-by: wuke2022 <[email protected]>
This commit is contained in:
Neginegiandwuke2022 authored and GitHub committed 2023-02-19 21:22:20 +08:00
1 parent 74c24ad860
commit c0e24ce869
19 files changed
+41 -270

No files matched your search

@@ -9,6 +9,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../../../../api/api.dart';
import '../../../../api/model/downloader_config.dart';
import '../../../../core/common/start_config.dart';
import '../../../../generated/locales.g.dart';
import '../../../../i18n/messages.dart';
import '../../../../util/log_util.dart';
import '../../../../util/util.dart';
@@ -184,7 +185,7 @@ class AppController extends GetxController {
}
if (extra.locale.isEmpty) {
final systemLocale = getLocaleKey(ui.window.locale);
extra.locale = messages.keys.containsKey(systemLocale)
extra.locale = AppTranslation.translations.containsKey(systemLocale)
? systemLocale
: getLocaleKey(fallbackLocale);
}
@@ -29,7 +29,8 @@ class AppView extends GetView<AppController> {
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: messages.keys.keys.map((e) => toLocale(e)).toList(),
supportedLocales:
AppTranslation.translations.keys.map((e) => toLocale(e)).toList(),
getPages: AppPages.routes,
);
}
@@ -31,7 +31,7 @@ class CreateView extends GetView<CreateController> {
icon: const Icon(Icons.arrow_back),
onPressed: () => Get.rootDelegate.offNamed(Routes.DOWNLOADING)),
// actions: [],
title: Text('create.title'.tr),
title: Text('create'.tr),
),
body: DropTarget(
onDragDone: (details) {
@@ -52,12 +52,12 @@ class CreateView extends GetView<CreateController> {
decoration: InputDecoration(
hintText: _hitText(),
hintStyle: const TextStyle(fontSize: 12),
labelText: 'create.downloadLink'.tr,
labelText: 'downloadLink'.tr,
icon: const Icon(Icons.link)),
validator: (v) {
return v!.trim().isNotEmpty
? null
: 'create.downloadLinkValid'.tr;
: 'downloadLinkValid'.tr;
}),
Center(
child: Padding(
@@ -98,8 +98,8 @@ class CreateView extends GetView<CreateController> {
}
String _hitText() {
return 'create.downloadLinkHit'.trParams({
'append': Util.isDesktop() ? 'create.downloadLinkHitDesktop'.tr : '',
return 'downloadLinkHit'.trParams({
'append': Util.isDesktop() ? 'downloadLinkHitDesktop'.tr : '',
});
}
@@ -172,7 +172,7 @@ class CreateView extends GetView<CreateController> {
// if (Util.isAndroid()) {
// if (!await Permission.storage.request().isGranted) {
// Get.snackbar('error'.tr,
// 'create.error.noStoragePermission'.tr);
// 'noStoragePermission'.tr);
// return;
// }
// }
@@ -195,7 +195,7 @@ class CreateView extends GetView<CreateController> {
}
},
controller: downloadController,
child: Text('create.download'.tr),
child: Text('download'.tr),
),
),
],
@@ -22,7 +22,7 @@ class HomeView extends GetView<HomeController> {
? NavigationRail(
extended: true,
labelType: NavigationRailLabelType.none,
minExtendedWidth: 140,
minExtendedWidth: 170,
groupAlignment: 0,
// useIndicator: false,
onDestinationSelected: (int index) {
@@ -7,6 +7,7 @@ import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../../../generated/locales.g.dart';
import '../../../../i18n/messages.dart';
import '../../../../util/package_info.dart';
import '../../../../util/util.dart';
@@ -202,7 +203,8 @@ class SettingView extends GetView<SettingController> {
));
final buildLocale = _buildConfigItem(
'locale',
() => messages.keys[downloaderCfg.value.extra.locale]!['label']!,
() => AppTranslation
.translations[downloaderCfg.value.extra.locale]!['label']!,
(Key key) => DropdownButton<String>(
key: key,
value: downloaderCfg.value.extra.locale,
@@ -216,10 +218,10 @@ class SettingView extends GetView<SettingController> {
await debounceSave();
},
items: messages.keys.keys
items: AppTranslation.translations.keys
.map((e) => DropdownMenuItem<String>(
value: e,
child: Text(messages.keys[e]!['label']!),
child: Text(AppTranslation.translations[e]!['label']!),
))
.toList(),
));