Skip to content

Commit dbc9c4c

Browse files
hugetinywuke2022
and
wuke2022
authored
fix docs and locales (#86)
* 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 * fix:locale fix * docs: add detailed bash for build and dev --------- Co-authored-by: wuke2022 <[email protected]>
1 parent c0e24ce commit dbc9c4c

13 files changed

+115
-29
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Please refer to `en_us.dart` for translation.
3232

3333
## flutter development
3434

35-
Don't forget to run`dart format .`before you commit to keep your code in standard dart format
35+
Don't forget to run`dart format ./ui/flutter`before you commit to keep your code in standard dart format
3636

3737
Turn on build_runner watcher if you want to edit api/models:
3838

CONTRIBUTING_zh-CN.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,20 @@ PR,合并到 `main` 分支。
1313
flutter 项目即可运行。
1414

1515
## 翻译
16-
17-
Gopeed 的国际化文件位于 `ui/flutter/assets/locales` 目录下,只需要在该目录下添加对应的语言文件即可。
1816

17+
Gopeed 的国际化文件位于 `ui/flutter/assets/locales` 目录下,只需要在该目录下添加对应的语言文件即可。
1918

2019
编辑locales后请运行以下命令:
2120

22-
2321
```
2422
get generate locales
2523
```
2624

2725
请注意以 `en_US.json` 为参照进行翻译。
2826

29-
3027
## flutter开发
3128

32-
33-
每次提交前请务必运行`dart format .`
29+
每次提交前请务必`dart format ./ui/flutter`
3430

3531
如果要编辑api/models,请打开build_runner watcher:
3632

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ cd ../../
146146
rm -rf cmd/web/dist
147147
cp -r ui/flutter/build/web cmd/web/dist
148148
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
149-
````
149+
go run cmd/web/main.go
150+
```
150151

151152
## License
152153

README_zh-CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ cd ../../
146146
rm -rf cmd/web/dist
147147
cp -r ui/flutter/build/web cmd/web/dist
148148
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
149+
go run cmd/web/main.go
149150
```
150151

151152
## 开源许可

ui/flutter/.fvm/flutter_sdk

-1
This file was deleted.

ui/flutter/.fvm/fvm_config.json

-4
This file was deleted.

ui/flutter/lib/app/modules/app/controllers/app_controller.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import '../../../../api/api.dart';
1010
import '../../../../api/model/downloader_config.dart';
1111
import '../../../../core/common/start_config.dart';
1212
import '../../../../generated/locales.g.dart';
13-
import '../../../../i18n/messages.dart';
13+
import '../../../../i18n/localeManager.dart';
1414
import '../../../../util/log_util.dart';
1515
import '../../../../util/util.dart';
1616

ui/flutter/lib/app/modules/app/views/app_view.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
33
import 'package:get/get.dart';
44

55
import '../../../../generated/locales.g.dart';
6-
import '../../../../i18n/messages.dart';
6+
import '../../../../i18n/localeManager.dart';
77
import '../../../../theme/theme.dart';
88
import '../../../routes/app_pages.dart';
99
import '../controllers/app_controller.dart';

ui/flutter/lib/app/modules/setting/views/setting_view.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:intl/intl.dart';
88
import 'package:url_launcher/url_launcher.dart';
99

1010
import '../../../../generated/locales.g.dart';
11-
import '../../../../i18n/messages.dart';
11+
import '../../../../i18n/localeManager.dart';
1212
import '../../../../util/package_info.dart';
1313
import '../../../../util/util.dart';
1414
import '../../../views/views/check_list_view.dart';

ui/flutter/lib/app/views/views/buid_task_list_view.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ class BuildTaskListView extends GetView {
7878
context: context,
7979
barrierDismissible: false,
8080
builder: (_) => AlertDialog(
81-
title: Text('task.deleteTask'.tr),
81+
title: Text('deleteTask'.tr),
8282
content: Obx(() => CheckboxListTile(
8383
value: keep.value,
84-
title: Text('task.deleteTaskTip'.tr,
84+
title: Text('deleteTaskTip'.tr,
8585
style: context.textTheme.bodyLarge),
8686
onChanged: (v) {
8787
keep.value = v!;
@@ -93,7 +93,7 @@ class BuildTaskListView extends GetView {
9393
),
9494
TextButton(
9595
child: Text(
96-
'task.delete'.tr,
96+
'delete'.tr,
9797
style: const TextStyle(color: Colors.redAccent),
9898
),
9999
onPressed: () async {

ui/flutter/lib/i18n/messages.dart ui/flutter/lib/i18n/localeManager.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ String getLocaleKey(Locale locale) {
99
return '${locale.languageCode}_${locale.countryCode}';
1010
}
1111

12-
const mainLocale = Locale('zh', 'CN');
12+
const debugLocale = Locale('zh', 'CN');
1313
const fallbackLocale = Locale('en', 'US');

ui/flutter/lib/main.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import 'package:flutter/foundation.dart';
22
import 'package:flutter/material.dart';
33
import 'package:get/get.dart';
44
import 'package:gopeed/api/api.dart' as api;
5-
import 'package:gopeed/i18n/messages.dart';
65

76
import 'app/modules/app/controllers/app_controller.dart';
87
import 'app/modules/app/views/app_view.dart';
98
import 'core/libgopeed_boot.dart';
109
import 'generated/locales.g.dart';
10+
import 'i18n/localeManager.dart';
1111
import 'util/log_util.dart';
1212
import 'util/mac_secure_util.dart';
1313
import 'util/package_info.dart';
@@ -50,9 +50,9 @@ Future<void> onStart() async {
5050
final appController = Get.find<AppController>();
5151
await appController.trackerUpdateOnStart();
5252

53-
// if is debug mode, check language message is complete
53+
// if is debug mode, check language message is complete,change debug locale to your comfortable language if you want
5454
if (kDebugMode) {
55-
final mainLang = getLocaleKey(mainLocale);
55+
final mainLang = getLocaleKey(debugLocale);
5656
final fullMessages = AppTranslation.translations[mainLang];
5757
AppTranslation.translations.keys
5858
.where((e) => e != mainLang)

ui/flutter/lib/util/file_icon.dart

+99-6
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,90 @@ findIcon(String ext) {
1212
const List iconMaps = [
1313
//media
1414
{
15-
'extensions': ['jpg', 'png', 'gif', 'bmp', 'jpeg', 'jpe', 'jif', 'jfif', 'jfi', 'webp', 'tiff', 'tif', 'ico', 'svg', 'webp'],
15+
'extensions': [
16+
'jpg',
17+
'png',
18+
'gif',
19+
'bmp',
20+
'jpeg',
21+
'jpe',
22+
'jif',
23+
'jfif',
24+
'jfi',
25+
'webp',
26+
'tiff',
27+
'tif',
28+
'ico',
29+
'svg',
30+
'webp'
31+
],
1632
'type': 'Image',
1733
'thumbnail': 'file_image'
1834
},
1935
{
20-
'extensions': ['mp4', 'webm', 'mpg', 'mp2', 'mpeg', 'mpe', 'mpv', 'ocg', 'm4p', 'm4v', 'avi', 'wmv', 'mov', 'qt', 'flv', 'swf', 'mkv', 'rmvb', 'rm', 'vob', '3gp'],
36+
'extensions': [
37+
'mp4',
38+
'webm',
39+
'mpg',
40+
'mp2',
41+
'mpeg',
42+
'mpe',
43+
'mpv',
44+
'ocg',
45+
'm4p',
46+
'm4v',
47+
'avi',
48+
'wmv',
49+
'mov',
50+
'qt',
51+
'flv',
52+
'swf',
53+
'mkv',
54+
'rmvb',
55+
'rm',
56+
'vob',
57+
'3gp'
58+
],
2159
'type': 'Video',
2260
'thumbnail': 'my_movies_t_v'
2361
},
2462
{
25-
'extensions': ['mp3', 'ogg', 'ogm', 'wav', '.aac', '.ape', '.flac', '.flav', '.m4a', '.wma'],
63+
'extensions': [
64+
'mp3',
65+
'ogg',
66+
'ogm',
67+
'wav',
68+
'.aac',
69+
'.ape',
70+
'.flac',
71+
'.flav',
72+
'.m4a',
73+
'.wma'
74+
],
2675
'type': 'Audio',
2776
'thumbnail': 'music_in_collection_fill'
2877
},
2978
//compressed
3079
{
31-
'extensions': ['7z', 'brotli', 'bzip2', 'gz', 'gzip', 'rar', 'tgz', 'xz', 'zip', 'zstd', 'deb', 'msi', 'snap', 'iso', 'dmg', 'dockerfile', 'dockerignore'],
80+
'extensions': [
81+
'7z',
82+
'brotli',
83+
'bzip2',
84+
'gz',
85+
'gzip',
86+
'rar',
87+
'tgz',
88+
'xz',
89+
'zip',
90+
'zstd',
91+
'deb',
92+
'msi',
93+
'snap',
94+
'iso',
95+
'dmg',
96+
'dockerfile',
97+
'dockerignore'
98+
],
3299
'type': 'Archive',
33100
'thumbnail': 'package'
34101
},
@@ -49,7 +116,18 @@ const List iconMaps = [
49116
'thumbnail': 'excel_document'
50117
},
51118
{
52-
'extensions': ['pot', 'potm', 'potx', 'ppam', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptn', 'pptx'],
119+
'extensions': [
120+
'pot',
121+
'potm',
122+
'potx',
123+
'ppam',
124+
'pps',
125+
'ppsm',
126+
'ppsx',
127+
'ppt',
128+
'pptn',
129+
'pptx'
130+
],
53131
'type': 'Powerpoint Document',
54132
'thumbnail': 'power_point_document'
55133
},
@@ -60,7 +138,22 @@ const List iconMaps = [
60138
'thumbnail': 'file_symlink'
61139
},
62140
{
63-
'extensions': ['ini', 'dlc', 'config', 'conf', 'properties', 'prop', 'settings', 'option', 'props', 'toml', 'prefs', 'sln.dotsettings', 'sln.dotsettings.user', 'cfg'],
141+
'extensions': [
142+
'ini',
143+
'dlc',
144+
'config',
145+
'conf',
146+
'properties',
147+
'prop',
148+
'settings',
149+
'option',
150+
'props',
151+
'toml',
152+
'prefs',
153+
'sln.dotsettings',
154+
'sln.dotsettings.user',
155+
'cfg'
156+
],
64157
'type': 'Settings',
65158
'thumbnail': 'text_document_settings'
66159
},

0 commit comments

Comments
 (0)