Skip to content

Commit

Permalink
Merge pull request #135 from mcthesw/dev
Browse files Browse the repository at this point in the history
merge: 修复bug,增加日志,优化i18n,优化配置文件版本处理

- fix(frontend): 不再允许同名游戏加入(修改为大小写不敏感)
- build(deps): 升级第三方库 
- chore: 更新Vscode推荐插件
- fix: 游戏名以空格结尾,创建游戏失败(禁止该操作)
- fix(frontend): 拖拽排序适配滚轮 
- feat(frontend): 恢复/创建结束再关闭警告信息
- docs(frontend): 增加开发时可用Vue DevTools的教程文档
- feat: 引入tracing作为日志系统
- refactor(frontend): 修复前端黑暗模式的一些颜色问题
- feat: 更好的版本升级处理 
- fix(frontend): 修复添加存档多时前端表格溢出不显示 
- feat: 增加批量删除功能
- @mcthesw
refactor(i18n): 修复i18n问题,优化后端i18n
  • Loading branch information
mcthesw authored Aug 19, 2024
2 parents cee2f83 + 1dc79a6 commit 503edd3
Show file tree
Hide file tree
Showing 40 changed files with 3,034 additions and 1,828 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ko_fi: sworld233
custom: ['https://afdian.com/a/Sworld']
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dist-ssr
# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/i18n-ally-custom-framework.yml
.idea
.DS_Store
*.suo
Expand All @@ -25,4 +26,5 @@ dist-ssr

# auto-generated files
components.d.ts
auto-imports.d.ts
auto-imports.d.ts
.aider*
8 changes: 5 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"recommendations": [
"Vue.volar",
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer"
"rust-lang.rust-analyzer",
"lokalise.i18n-ally",
"vivaxy.vscode-conventional-commits",
"vue.volar"
]
}
}
7 changes: 7 additions & 0 deletions .vscode/i18n-ally-custom-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
languageIds:
- rust

usageMatchRegex:
- "[^\\w\\d]t!\\([\\s\\n\\r]*['\"]({key})['\"]"

monopoly: true
8 changes: 0 additions & 8 deletions auto-imports.d.ts

This file was deleted.

42 changes: 0 additions & 42 deletions components.d.ts

This file was deleted.

50 changes: 33 additions & 17 deletions doc/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ You will need the following environment installed beforehand:
### Editors and Plugins

- Visual Studio Code (recommended)
- Rust-analyzer
- Tauri
- Vue - Official
- Element Plus Snippets
- i18n Allay
- Rust-analyzer
- Tauri
- Vue - Official
- Element Plus Snippets
- i18n Allay
- WebStorm
- RustRover

Expand All @@ -31,6 +31,7 @@ You will need the following environment installed beforehand:
### Build and Development

Refer to `package.json` for commands

- `pnpm tauri:dev` Development mode, preview while developing
- `pnpm tauri:build` Build and package, output will be stored in `src-tauri/target`

Expand All @@ -39,14 +40,14 @@ Refer to `package.json` for commands
The software is divided into two main parts:

- Frontend is responsible for the user interface and interaction. It is written in TypeScript and Vue3
- Uses Element Plus component library
- Uses pinia for state management
- Uses vue-router for frontend routing
- Uses vue-i18n for internationalization
- Uses Element Plus component library
- Uses pinia for state management
- Uses vue-router for frontend routing
- Uses vue-i18n for internationalization
- Backend is responsible for managing the game save files. It is written in Rust
- Uses opendal for cloud storage access
- Uses serde for data serialization and deserialization
- Uses thiserror and anyhow for error handling
- Uses opendal for cloud storage access
- Uses serde for data serialization and deserialization
- Uses thiserror and anyhow for error handling

## Development Process

Expand All @@ -59,6 +60,21 @@ To contribute to the Game-save-manager project, you will need to:
5. Push your changes to your forked repository on GitHub
6. Create a pull request to merge your changes into the `dev` branch of the main repository

## Using `vue-devtools`

First, you need to install the devtools and start them correctly.

```bash
pnpm add -g @vue/devtools@next
vue-devtools
```

Next, please find the `index.html` in the project root directory and add the following content inside the `<head>` tag.

```html
<script src="http://localhost:8098"></script>
```

## Coding Style

There is no formal coding style document at the moment, if you could help complete this part of the documentation I would be very grateful, for the time being please refer to the rest of the codebase, try to keep it concise and leave proper documentation
Expand Down Expand Up @@ -86,9 +102,9 @@ Other developers do not need to change the version number, just add your updates
- public: Static files
- scripts: Scripts used for Github Actions
- src: Source code for the frontend project
- assets: Static assets
- locales: Internationalization resources
- schemas: Schemas for saving data
- Refer to folder names for others
- assets: Static assets
- locales: Internationalization resources
- schemas: Schemas for saving data
- Refer to folder names for others
- src-tauri: Root directory for the backend project
- src: Source code for the backend project
- src: Source code for the backend project
50 changes: 33 additions & 17 deletions doc/zh-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
### 编辑器和插件

- Visual Studio Code(推荐)
- Rust-analyzer
- Tauri
- Vue - Official
- Element Plus Snippets
- i18n Allay
- Rust-analyzer
- Tauri
- Vue - Official
- Element Plus Snippets
- i18n Allay
- WebStorm
- RustRover

Expand All @@ -31,6 +31,7 @@
### 编译与开发

请参考`package.json`来了解指令

- `pnpm tauri:dev` 开发模式,一边预览一边开发
- `pnpm tauri:build` 编译打包,输出会存放在`src-tauri/target`

Expand All @@ -39,14 +40,14 @@
该软件分为两个主要部分:

- 前端负责用户界面和交互。它使用 TypeScript 和 Vue3 编写
- 使用 Element Plus 组件库
- 使用 pinia 进行状态管理
- 使用 vue-router 作为前端路由
- 使用 vue-i18n 进行国际化
- 使用 Element Plus 组件库
- 使用 pinia 进行状态管理
- 使用 vue-router 作为前端路由
- 使用 vue-i18n 进行国际化
- 后端负责管理游戏存档文件。它使用 Rust 编写
- 使用 opendal 来访问云存储
- 使用 serde 来序列化和反序列化数据
- 使用 thiserror 和 anyhow 进行错误处理
- 使用 opendal 来访问云存储
- 使用 serde 来序列化和反序列化数据
- 使用 thiserror 和 anyhow 进行错误处理

## 开发流程

Expand All @@ -59,6 +60,21 @@
5. 将你的更改推送到你在 GitHub 上 Fork 的存储库
6. 创建一个 pull request,将你的更改合并到主存储库的 `dev` 分支中

## 使用`vue-devtools`

首先需要安装 devtools,并且正确启动

```bash
pnpm add -g @vue/devtools@next
vue-devtools
```

接下来请在项目根目录下找到`index.html`,并且在`<head>`标签中添加以下内容

```html
<script src="http://localhost:8098"></script>
```

## 编码风格

暂时没有完善的编码风格文档,如果你能帮助完成这部分文档我将不胜感激,暂时请参考其余部分代码,尽量保持简洁,且留下合适的文档
Expand Down Expand Up @@ -86,9 +102,9 @@
- public: 静态文件
- scripts: 用于 Github Action 的脚本
- src: 前端项目的源代码
- assets: 静态资源
- locales: 国际化资源
- schemas: 保存数据的格式
- 其他请参考文件夹名
- assets: 静态资源
- locales: 国际化资源
- schemas: 保存数据的格式
- 其他请参考文件夹名
- src-tauri: 后端项目的根目录
- src: 后端项目的源代码
- src: 后端项目的源代码
58 changes: 37 additions & 21 deletions locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@
"failed": "Operation failed",
"operation_canceled": "You have cancelled this operation",
"default_expend_favorites_tree": "Whether to expand favorites by default",
"homepage": "Homepage"
"homepage": "Homepage",
"open_log_folder": "Open log",
"log_to_file": "Generate file log",
"setting_tips": "An asterisk indicates that it will take effect after restarting, and the remaining settings will take effect after saving."
},
"home": {
"hello_world": "Hello world",
Expand Down Expand Up @@ -94,7 +97,9 @@
"change_description_failed": "Modification failed",
"set_quick_backup": "Enable quick backup",
"set_quick_backup_success": "Settings saved. You can now use keyboard shortcuts or the tray icon for quick operations",
"set_quick_backup_failed": "Setting failed"
"set_quick_backup_failed": "Setting failed",
"batch_delete": "Batch delete",
"batch_delete_prompt": "Note that this operation will delete all selected saves, please enter yes to confirm"
},
"addgame": {
"search_local": "Detect local games",
Expand All @@ -116,7 +121,7 @@
"path": "Path",
"warning_for_save_file": "Adding files or folders with the same name is currently not supported. Please refrain from doing so. If needed, please provide feedback, and I will consider implementing it",
"invalid_name_error": "Invalid game name. Please avoid including special characters that cannot be used to create files",
"duplicated_name_error": "Game name duplicated"
"duplicated_name_error": "Game name duplicated (The game name is case-insensitive)"
},
"app": {
"early_access_warning": "This is an early test version. Stability cannot be guaranteed. Please use with caution"
Expand Down Expand Up @@ -224,25 +229,36 @@
"delete_game_failed": "Failed to delete game",
"open_backup_folder_failed": "Failed to open backup folder",
"set_config_failed": "Failed to set config",
"reset_settings_failed": "Failed to reset settings"
"reset_settings_failed": "Failed to reset settings",
"change_description_failed": "Failed to edit description",
"open_log_folder_failed": "Cannot open log folder"
},
"tray": {
"no_game_selected": "No game selected",
"auto_backup_interval": "Auto backup interval",
"turn_off_auto_backup": "Disable auto backup",
"5_minute": "5 minutes",
"10_minute": "10 minutes",
"30_minute": "30 minutes",
"60_minute": "60 minutes",
"quick_backup": "Quick backup",
"quick_apply": "Quick apply",
"exit": "Exit",
"success": "Success",
"error": "Error"
},
"backend_config": {
"updating_config_title": "Updating config file",
"updating_config_body": "The config file has been updated, and the old one will be backed up as GameSaveManagerConfig.json.bak"
"backend": {
"config": {
"updating_config_title": "Updating config file",
"updating_config_body": "The config file has been updated, and the old one will be backed up as GameSaveManagerConfig.json.bak"
},
"tray": {
"no_game_selected": "No game selected",
"auto_backup_interval": "Auto backup interval",
"turn_off_auto_backup": "Disable auto backup",
"5_minute": "5 minutes",
"10_minute": "10 minutes",
"30_minute": "30 minutes",
"60_minute": "60 minutes",
"quick_backup": "Quick backup",
"quick_apply": "Quick apply",
"exit": "Exit",
"success": "Success",
"error": "Error"
},
"backup": {
"extra_backup_file_not_exist": "Since the file does not exist, the extra backup (pre-overwrite backup) cannot be completed and the recovery is aborted. If you don't need this feature, turn it off in settings.",
"backup_file_not_exist": "File {name} does not exist, cannot be backed up or restored"
},
"archive": {
"file_not_exist": "The path {path} does not exist and has been automatically created."
}
},
"favorite": {
"favorite_manage": "Favorite Management",
Expand Down
Loading

0 comments on commit 503edd3

Please sign in to comment.