mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 14:23:42 +00:00
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]>
This commit is contained in:
1 parent
c0e24ce869
commit
dbc9c4c121
13 files changed
+115
-29
No files matched your search
+1
-1
@@ -32,7 +32,7 @@ Please refer to `en_us.dart` for translation.
|
|||||||
|
|
||||||
## flutter development
|
## flutter development
|
||||||
|
|
||||||
Don't forget to run`dart format .`before you commit to keep your code in standard dart format
|
Don't forget to run`dart format ./ui/flutter`before you commit to keep your code in standard dart format
|
||||||
|
|
||||||
Turn on build_runner watcher if you want to edit api/models:
|
Turn on build_runner watcher if you want to edit api/models:
|
||||||
|
|
||||||
|
|||||||
@@ -13,24 +13,20 @@ PR,合并到 `main` 分支。
|
|||||||
flutter 项目即可运行。
|
flutter 项目即可运行。
|
||||||
|
|
||||||
## 翻译
|
## 翻译
|
||||||
|
|
||||||
Gopeed 的国际化文件位于 `ui/flutter/assets/locales` 目录下,只需要在该目录下添加对应的语言文件即可。
|
Gopeed 的国际化文件位于 `ui/flutter/assets/locales` 目录下,只需要在该目录下添加对应的语言文件即可。
|
||||||
|
|
||||||
|
|
||||||
编辑locales后请运行以下命令:
|
编辑locales后请运行以下命令:
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
get generate locales
|
get generate locales
|
||||||
```
|
```
|
||||||
|
|
||||||
请注意以 `en_US.json` 为参照进行翻译。
|
请注意以 `en_US.json` 为参照进行翻译。
|
||||||
|
|
||||||
|
|
||||||
## flutter开发
|
## flutter开发
|
||||||
|
|
||||||
|
每次提交前请务必`dart format ./ui/flutter`
|
||||||
每次提交前请务必运行`dart format .`
|
|
||||||
|
|
||||||
如果要编辑api/models,请打开build_runner watcher:
|
如果要编辑api/models,请打开build_runner watcher:
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ cd ../../
|
|||||||
rm -rf cmd/web/dist
|
rm -rf cmd/web/dist
|
||||||
cp -r ui/flutter/build/web cmd/web/dist
|
cp -r ui/flutter/build/web cmd/web/dist
|
||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
````
|
go run cmd/web/main.go
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ cd ../../
|
|||||||
rm -rf cmd/web/dist
|
rm -rf cmd/web/dist
|
||||||
cp -r ui/flutter/build/web cmd/web/dist
|
cp -r ui/flutter/build/web cmd/web/dist
|
||||||
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
go build -tags nosqlite,web -ldflags="-s -w" -o bin/ github.com/GopeedLab/gopeed/cmd/web
|
||||||
|
go run cmd/web/main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
## 开源许可
|
## 开源许可
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
C:/Users/huget/fvm/versions/3.7.0
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"flutterSdkVersion": "3.7.0",
|
|
||||||
"flavors": {}
|
|
||||||
}
|
|
||||||
@@ -10,7 +10,7 @@ import '../../../../api/api.dart';
|
|||||||
import '../../../../api/model/downloader_config.dart';
|
import '../../../../api/model/downloader_config.dart';
|
||||||
import '../../../../core/common/start_config.dart';
|
import '../../../../core/common/start_config.dart';
|
||||||
import '../../../../generated/locales.g.dart';
|
import '../../../../generated/locales.g.dart';
|
||||||
import '../../../../i18n/messages.dart';
|
import '../../../../i18n/localeManager.dart';
|
||||||
import '../../../../util/log_util.dart';
|
import '../../../../util/log_util.dart';
|
||||||
import '../../../../util/util.dart';
|
import '../../../../util/util.dart';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../../generated/locales.g.dart';
|
import '../../../../generated/locales.g.dart';
|
||||||
import '../../../../i18n/messages.dart';
|
import '../../../../i18n/localeManager.dart';
|
||||||
import '../../../../theme/theme.dart';
|
import '../../../../theme/theme.dart';
|
||||||
import '../../../routes/app_pages.dart';
|
import '../../../routes/app_pages.dart';
|
||||||
import '../controllers/app_controller.dart';
|
import '../controllers/app_controller.dart';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../../../generated/locales.g.dart';
|
import '../../../../generated/locales.g.dart';
|
||||||
import '../../../../i18n/messages.dart';
|
import '../../../../i18n/localeManager.dart';
|
||||||
import '../../../../util/package_info.dart';
|
import '../../../../util/package_info.dart';
|
||||||
import '../../../../util/util.dart';
|
import '../../../../util/util.dart';
|
||||||
import '../../../views/views/check_list_view.dart';
|
import '../../../views/views/check_list_view.dart';
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ class BuildTaskListView extends GetView {
|
|||||||
context: context,
|
context: context,
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
builder: (_) => AlertDialog(
|
builder: (_) => AlertDialog(
|
||||||
title: Text('task.deleteTask'.tr),
|
title: Text('deleteTask'.tr),
|
||||||
content: Obx(() => CheckboxListTile(
|
content: Obx(() => CheckboxListTile(
|
||||||
value: keep.value,
|
value: keep.value,
|
||||||
title: Text('task.deleteTaskTip'.tr,
|
title: Text('deleteTaskTip'.tr,
|
||||||
style: context.textTheme.bodyLarge),
|
style: context.textTheme.bodyLarge),
|
||||||
onChanged: (v) {
|
onChanged: (v) {
|
||||||
keep.value = v!;
|
keep.value = v!;
|
||||||
@@ -93,7 +93,7 @@ class BuildTaskListView extends GetView {
|
|||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
'task.delete'.tr,
|
'delete'.tr,
|
||||||
style: const TextStyle(color: Colors.redAccent),
|
style: const TextStyle(color: Colors.redAccent),
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ String getLocaleKey(Locale locale) {
|
|||||||
return '${locale.languageCode}_${locale.countryCode}';
|
return '${locale.languageCode}_${locale.countryCode}';
|
||||||
}
|
}
|
||||||
|
|
||||||
const mainLocale = Locale('zh', 'CN');
|
const debugLocale = Locale('zh', 'CN');
|
||||||
const fallbackLocale = Locale('en', 'US');
|
const fallbackLocale = Locale('en', 'US');
|
||||||
@@ -2,12 +2,12 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:gopeed/api/api.dart' as api;
|
import 'package:gopeed/api/api.dart' as api;
|
||||||
import 'package:gopeed/i18n/messages.dart';
|
|
||||||
|
|
||||||
import 'app/modules/app/controllers/app_controller.dart';
|
import 'app/modules/app/controllers/app_controller.dart';
|
||||||
import 'app/modules/app/views/app_view.dart';
|
import 'app/modules/app/views/app_view.dart';
|
||||||
import 'core/libgopeed_boot.dart';
|
import 'core/libgopeed_boot.dart';
|
||||||
import 'generated/locales.g.dart';
|
import 'generated/locales.g.dart';
|
||||||
|
import 'i18n/localeManager.dart';
|
||||||
import 'util/log_util.dart';
|
import 'util/log_util.dart';
|
||||||
import 'util/mac_secure_util.dart';
|
import 'util/mac_secure_util.dart';
|
||||||
import 'util/package_info.dart';
|
import 'util/package_info.dart';
|
||||||
@@ -50,9 +50,9 @@ Future<void> onStart() async {
|
|||||||
final appController = Get.find<AppController>();
|
final appController = Get.find<AppController>();
|
||||||
await appController.trackerUpdateOnStart();
|
await appController.trackerUpdateOnStart();
|
||||||
|
|
||||||
// if is debug mode, check language message is complete
|
// if is debug mode, check language message is complete,change debug locale to your comfortable language if you want
|
||||||
if (kDebugMode) {
|
if (kDebugMode) {
|
||||||
final mainLang = getLocaleKey(mainLocale);
|
final mainLang = getLocaleKey(debugLocale);
|
||||||
final fullMessages = AppTranslation.translations[mainLang];
|
final fullMessages = AppTranslation.translations[mainLang];
|
||||||
AppTranslation.translations.keys
|
AppTranslation.translations.keys
|
||||||
.where((e) => e != mainLang)
|
.where((e) => e != mainLang)
|
||||||
|
|||||||
@@ -12,23 +12,90 @@ findIcon(String ext) {
|
|||||||
const List iconMaps = [
|
const List iconMaps = [
|
||||||
//media
|
//media
|
||||||
{
|
{
|
||||||
'extensions': ['jpg', 'png', 'gif', 'bmp', 'jpeg', 'jpe', 'jif', 'jfif', 'jfi', 'webp', 'tiff', 'tif', 'ico', 'svg', 'webp'],
|
'extensions': [
|
||||||
|
'jpg',
|
||||||
|
'png',
|
||||||
|
'gif',
|
||||||
|
'bmp',
|
||||||
|
'jpeg',
|
||||||
|
'jpe',
|
||||||
|
'jif',
|
||||||
|
'jfif',
|
||||||
|
'jfi',
|
||||||
|
'webp',
|
||||||
|
'tiff',
|
||||||
|
'tif',
|
||||||
|
'ico',
|
||||||
|
'svg',
|
||||||
|
'webp'
|
||||||
|
],
|
||||||
'type': 'Image',
|
'type': 'Image',
|
||||||
'thumbnail': 'file_image'
|
'thumbnail': 'file_image'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'extensions': ['mp4', 'webm', 'mpg', 'mp2', 'mpeg', 'mpe', 'mpv', 'ocg', 'm4p', 'm4v', 'avi', 'wmv', 'mov', 'qt', 'flv', 'swf', 'mkv', 'rmvb', 'rm', 'vob', '3gp'],
|
'extensions': [
|
||||||
|
'mp4',
|
||||||
|
'webm',
|
||||||
|
'mpg',
|
||||||
|
'mp2',
|
||||||
|
'mpeg',
|
||||||
|
'mpe',
|
||||||
|
'mpv',
|
||||||
|
'ocg',
|
||||||
|
'm4p',
|
||||||
|
'm4v',
|
||||||
|
'avi',
|
||||||
|
'wmv',
|
||||||
|
'mov',
|
||||||
|
'qt',
|
||||||
|
'flv',
|
||||||
|
'swf',
|
||||||
|
'mkv',
|
||||||
|
'rmvb',
|
||||||
|
'rm',
|
||||||
|
'vob',
|
||||||
|
'3gp'
|
||||||
|
],
|
||||||
'type': 'Video',
|
'type': 'Video',
|
||||||
'thumbnail': 'my_movies_t_v'
|
'thumbnail': 'my_movies_t_v'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'extensions': ['mp3', 'ogg', 'ogm', 'wav', '.aac', '.ape', '.flac', '.flav', '.m4a', '.wma'],
|
'extensions': [
|
||||||
|
'mp3',
|
||||||
|
'ogg',
|
||||||
|
'ogm',
|
||||||
|
'wav',
|
||||||
|
'.aac',
|
||||||
|
'.ape',
|
||||||
|
'.flac',
|
||||||
|
'.flav',
|
||||||
|
'.m4a',
|
||||||
|
'.wma'
|
||||||
|
],
|
||||||
'type': 'Audio',
|
'type': 'Audio',
|
||||||
'thumbnail': 'music_in_collection_fill'
|
'thumbnail': 'music_in_collection_fill'
|
||||||
},
|
},
|
||||||
//compressed
|
//compressed
|
||||||
{
|
{
|
||||||
'extensions': ['7z', 'brotli', 'bzip2', 'gz', 'gzip', 'rar', 'tgz', 'xz', 'zip', 'zstd', 'deb', 'msi', 'snap', 'iso', 'dmg', 'dockerfile', 'dockerignore'],
|
'extensions': [
|
||||||
|
'7z',
|
||||||
|
'brotli',
|
||||||
|
'bzip2',
|
||||||
|
'gz',
|
||||||
|
'gzip',
|
||||||
|
'rar',
|
||||||
|
'tgz',
|
||||||
|
'xz',
|
||||||
|
'zip',
|
||||||
|
'zstd',
|
||||||
|
'deb',
|
||||||
|
'msi',
|
||||||
|
'snap',
|
||||||
|
'iso',
|
||||||
|
'dmg',
|
||||||
|
'dockerfile',
|
||||||
|
'dockerignore'
|
||||||
|
],
|
||||||
'type': 'Archive',
|
'type': 'Archive',
|
||||||
'thumbnail': 'package'
|
'thumbnail': 'package'
|
||||||
},
|
},
|
||||||
@@ -49,7 +116,18 @@ const List iconMaps = [
|
|||||||
'thumbnail': 'excel_document'
|
'thumbnail': 'excel_document'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'extensions': ['pot', 'potm', 'potx', 'ppam', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptn', 'pptx'],
|
'extensions': [
|
||||||
|
'pot',
|
||||||
|
'potm',
|
||||||
|
'potx',
|
||||||
|
'ppam',
|
||||||
|
'pps',
|
||||||
|
'ppsm',
|
||||||
|
'ppsx',
|
||||||
|
'ppt',
|
||||||
|
'pptn',
|
||||||
|
'pptx'
|
||||||
|
],
|
||||||
'type': 'Powerpoint Document',
|
'type': 'Powerpoint Document',
|
||||||
'thumbnail': 'power_point_document'
|
'thumbnail': 'power_point_document'
|
||||||
},
|
},
|
||||||
@@ -60,7 +138,22 @@ const List iconMaps = [
|
|||||||
'thumbnail': 'file_symlink'
|
'thumbnail': 'file_symlink'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'extensions': ['ini', 'dlc', 'config', 'conf', 'properties', 'prop', 'settings', 'option', 'props', 'toml', 'prefs', 'sln.dotsettings', 'sln.dotsettings.user', 'cfg'],
|
'extensions': [
|
||||||
|
'ini',
|
||||||
|
'dlc',
|
||||||
|
'config',
|
||||||
|
'conf',
|
||||||
|
'properties',
|
||||||
|
'prop',
|
||||||
|
'settings',
|
||||||
|
'option',
|
||||||
|
'props',
|
||||||
|
'toml',
|
||||||
|
'prefs',
|
||||||
|
'sln.dotsettings',
|
||||||
|
'sln.dotsettings.user',
|
||||||
|
'cfg'
|
||||||
|
],
|
||||||
'type': 'Settings',
|
'type': 'Settings',
|
||||||
'thumbnail': 'text_document_settings'
|
'thumbnail': 'text_document_settings'
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user