Skip to content

Commit 428ffc7

Browse files
committed
✨ Feature: finish i18n system
1 parent 86012c0 commit 428ffc7

35 files changed

+1035
-538
lines changed

CONTRIBUTING.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## 贡献指南
2+
3+
### 安装与启动
4+
5+
1. 使用 [yarn](https://yarnpkg.com/) 安装依赖
6+
7+
```bash
8+
yarn install
9+
```
10+
11+
然后通过
12+
13+
```bash
14+
yarn dev
15+
```
16+
17+
启动项目。
18+
19+
2. 只跟 Electron 主进程相关的代码请在 `src/main` 目录下添加。只跟渲染进程相关的代码请在 `src/renderer` 目录下添加。两个进程都能使用的代码请在 `src/universal` 目录下添加。 **注意**:渲染进程没有 `Node.js` 能力,所有渲染进程需要用到 `Node.js` 模块相关的代码请在 `src/main/events/picgoCoreIPC.ts` 下添加事件进行处理。
20+
21+
3. 所有的跨进程事件名请在 `src/universal/events/constants.ts` 里添加。
22+
23+
4. 所有的全局类型定义请在 `src/universal/types/` 里添加,如果是 `enum`,请在 `src/universal/types/enum.ts` 里添加。
24+
25+
26+
### i18n
27+
28+
`public/i18n/` 下面创建一种语言的 `yml` 文件,例如 `zh-Hans.yml`。然后参考 `zh-CN.yml` 或者 `en.yml` 编写语言文件。并注意,PicGo 会通过语言文件中的 `LANG_DISPLAY_LABEL` 向用户展示该语言的名称。
29+
30+
### 提交代码
31+
32+
1. 请检查代码没有多余的注释、`console.log` 等调试代码。
33+
2. 提交代码前,请执行命令 `git add . && yarn cz`,唤起 PicGo 的[代码提交规范工具](https://github.com/PicGo/bump-version)。通过该工具提交代码。

CONTRIBUTING_EN.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Contribution Guidelines
2+
3+
### Installation and startup
4+
5+
1. Use [yarn](https://yarnpkg.com/) to install dependencies
6+
7+
```bash
8+
yarn install
9+
```
10+
11+
then pass
12+
13+
```bash
14+
yarn dev
15+
```
16+
17+
Startup project.
18+
19+
2. Please add code only related to the main process of Electron in the `src/main` directory. Code only related to the rendering process should be added in the `src/renderer` directory. Add code that can be used by both processes in the `src/universal` directory. **Note**: The rendering process does not have the `Node.js` capability. All rendering processes need to use `Node.js modules` related code, please add events under `src/main/events/picgoCoreIPC.ts` for processing.
20+
21+
3. Please add all cross-process event names in `src/universal/events/constants.ts`.
22+
23+
4. Please add all global type definitions in `src/universal/types/`, if it is `enum`, please add it in `src/universal/types/enum.ts`.
24+
25+
26+
### i18n
27+
28+
Create a `yml` file for a language under `public/i18n/`, e.g. `zh-Hans.yml`. Then refer to `zh-CN.yml` or `en.yml` to write language files. Also note that PicGo will display the name of the language to the user via `LANG_DISPLAY_LABEL` in the language file.
29+
30+
### Submit code
31+
32+
1. Please check that the code has no extra comments, `console.log` and other debugging code.
33+
2. Before submitting the code, please execute the command `git add . && yarn cz` to invoke PicGo's [Code Submission Specification Tool](https://github.com/PicGo/bump-version). Submit code through this tool.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Linux 用户请下载 `AppImage` 文件。
9696
2. `git clone https://github.com/Molunerfinn/PicGo.git` 并进入项目。
9797
3. `yarn` 下载依赖。注意如果你没有 `yarn`,请去 [官网](https://classic.yarnpkg.com/en/docs/install) 下载安装后再使用。 **`npm install` 将导致未知错误!**
9898
4. Mac 需要有 Xcode 环境,Windows 需要有 VS 环境。
99+
5. 如果需要贡献代码,可以参考[贡献指南](./CONTRIBUTING.md)
99100

100101
### 开发模式
101102

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"cz": "git-cz",
1515
"bump": "bump-version",
1616
"release": "vue-cli-service electron:build --publish always",
17-
"upload-dist": "node ./scripts/upload-dist-to-cos.js"
17+
"upload-dist": "node ./scripts/upload-dist-to-cos.js",
18+
"gen-i18n": "node ./scripts/gen-i18n-types.js"
1819
},
1920
"main": "background.js",
2021
"husky": {

public/i18n/en.yml

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
LANG_DISPLAY_LABEL: 'English'
2+
ABOUT: About
3+
OPEN_MAIN_WINDOW: Open Main Window
4+
CHOOSE_DEFAULT_PICBED: Choose Default Picbed
5+
OPEN_UPDATE_HELPER: Open Update Helper
6+
PRIVACY_AGREEMENT: Privacy Agreement
7+
RELOAD_APP: Reload App
8+
UPLOAD_FAILED: Upload Failed
9+
UPLOAD_SUCCEED: Upload Succeed
10+
UPLOAD_PROGRESS: Upload Progress
11+
OPERATION_FAILED: Operation Failed
12+
OPERATION_SUCCEED: Operation Succeed
13+
UPLOADING: Uploading
14+
QUICK_UPLOAD: Quick Upload
15+
UPLOAD_BY_CLIPBOARD: Upload by Clipboard
16+
HIDE_WINDOW: Hide Window
17+
SPONSOR_PICGO: Sponsor PicGo
18+
SHOW_PICBED_QRCODE: Show Picbed Qrcode
19+
PICBED_QRCODE: Picbed Qrcode
20+
ENABLE: Enable
21+
DISABLE: Disable
22+
CONFIG_THING: Config ${c}
23+
FIND_NEW_VERSION: Find New Version
24+
NO_MORE_NOTICE: No More Notice
25+
SHOW_DEVTOOLS: Show Devtools
26+
27+
# ---renderer i18n begin---
28+
29+
CHOOSE_YOUR_DEFAULT_PICBED: 'Choose ${d} as your default picbed:'
30+
UPLOAD_AREA: Upload Area
31+
GALLERY: Gallery
32+
PICBEDS_SETTINGS: Picbeds Settings
33+
PICGO_SETTINGS: PicGo Settings
34+
PLUGIN_SETTINGS: Plugins Settings
35+
PICGO_SPONSOR_TEXT: PicGo is a free software, if you like it, please don't forget to buy me a cup of coffee.
36+
ALIPAY: Alipay
37+
WECHATPAY: Wechat Pay
38+
CHOOSE_PICBED: Choose Picbed
39+
COPY_PICBED_CONFIG: Copy Picbed Config
40+
COPY_PICBED_CONFIG_SUCCEED: Copy Picbed Config Succeed
41+
INPUT: Input
42+
CANCEL: Cancel
43+
CONFIRM: Confirm
44+
CHOOSE_SHOWED_PICBED: Choose Showed Picbed
45+
CHOOSE_PASTE_FORMAT: Choose Paste Format
46+
SEARCH: Search
47+
COPY: Copy
48+
DELETE: Delete
49+
SELECT_ALL: Select All
50+
CHANGE_IMAGE_URL: Change Image URL
51+
CHANGE_IMAGE_URL_SUCCEED: Change Image URL Succeed
52+
COPY_LINK_SUCCEED: Copy Link Succeed
53+
BATCH_COPY_LINK_SUCCEED: Batch Copy Link Succeed
54+
FILE_RENAME: File Rename
55+
56+
# settings
57+
58+
SETTINGS: Settings
59+
SETTINGS_OPEN_CONFIG_FILE: Open Config File
60+
SETTINGS_CLICK_TO_OPEN: Click to Open
61+
SETTINGS_SET_LOG_FILE: Set Log File
62+
SETTINGS_CLICK_TO_SET: Click to Set
63+
SETTINGS_CLICK_TO_CHECK: Click to Check
64+
SETTINGS_SET_SHORTCUT: Set Shortcut
65+
SETTINGS_CUSTOM_LINK_FORMAT: Custom Link Format
66+
SETTINGS_SET_PROXY_AND_MIRROR: Set Proxy and Mirror
67+
SETTINGS_SET_SERVER: Set Server
68+
SETTINGS_CHECK_UPDATE: Check Update
69+
SETTINGS_OPEN_UPDATE_HELPER: Open Update Helper
70+
SETTINGS_OPEN: Open
71+
SETTINGS_CLOSE: Close
72+
SETTINGS_ACCEPT_BETA_UPDATE: Accept Beta Update
73+
SETTINGS_LAUNCH_ON_BOOT: Launch On Boot
74+
SETTINGS_RENAME_BEFORE_UPLOAD: Rename Before Upload
75+
SETTINGS_TIMESTAMP_RENAME: Timestamp Rename
76+
SETTINGS_OPEN_UPLOAD_TIPS: Open Upload Tips
77+
SETTINGS_MINI_WINDOW_ON_TOP: Mini Window On Top
78+
SETTINGS_AUTO_COPY_URL_AFTER_UPLOAD: Auto Copy URL After Upload
79+
SETTINGS_TIPS_PLACEHOLDER_URL: Use $url to represent url position
80+
SETTINGS_TIPS_PLACEHOLDER_FILENAME: Use $fileName to represent file name position
81+
SETTINGS_TIPS_SUCH_AS: 'Such as: $url/$fileName'
82+
SETTINGS_UPLOAD_PROXY: Upload Proxy
83+
SETTINGS_PLUGIN_INSTALL_PROXY: Proxy for Plugin Install
84+
SETTINGS_PLUGIN_INSTALL_MIRROR: Mirror for Plugin Install
85+
SETTINGS_CURRENT_VERSION: Current Version
86+
SETTINGS_NEWEST_VERSION: Newest Version
87+
SETTINGS_GETING: Getting...
88+
SETTINGS_TIPS_HAS_NEW_VERSION: PicGo has a new version, please click confirm to open download page
89+
SETTINGS_LOG_FILE: Log File
90+
SETTINGS_LOG_LEVEL: Log Level
91+
SETTINGS_LOG_FILE_SIZE: Log File Size
92+
SETTINGS_SET_PICGO_SERVER: Set PicGo Server
93+
SETTINGS_TIPS_SERVER_NOTICE: If you don't know what is the server's function, please read the document, or don't modify the configuration.
94+
SETTINGS_ENABLE_SERVER: Enable Server
95+
SETTINGS_SET_SERVER_HOST: Set Server Host
96+
SETTINGS_SET_SERVER_PORT: Set Server Port
97+
SETTINGS_TIP_PLACEHOLDER_HOST: Default:127.0.0.1
98+
SETTINGS_TIP_PLACEHOLDER_PORT: Default:36677
99+
SETTINGS_LOG_LEVEL_ALL: All
100+
SETTINGS_LOG_LEVEL_SUCCESS: Success
101+
SETTINGS_LOG_LEVEL_ERROR: Error
102+
SETTINGS_LOG_LEVEL_INFO: Info
103+
SETTINGS_LOG_LEVEL_WARN: Warn
104+
SETTINGS_LOG_LEVEL_NONE: None
105+
SETTINGS_RESULT: Result
106+
SETTINGS_DEFAULT_PICBED: Default Picbed
107+
SETTINGS_SET_DEFAULT_PICBED: Set Default Picbed
108+
SETTINGS_NOT_CONFIG_OPTIONS: Not Config Options
109+
SETTINGS_USE_BUILTIN_CLIPBOARD_UPLOAD: Use Builtin Clipboard to Upload
110+
SETTINGS_CHOOSE_LANGUAGE: Choose Language
111+
112+
# shortcut-page
113+
114+
BUILTIN_CLIPBOARD_TIPS: Use builtin clipboard function to upload instead of using scripts
115+
SHORTCUT_NAME: Shortcut Name
116+
SHORTCUT_BIND: Shortcut Binding
117+
SHORTCUT_STATUS: Status
118+
SHORTCUT_ENABLED: Enabled
119+
SHORTCUT_DISABLED: Disabled
120+
SHORTCUT_SOURCE: Source
121+
SHORTCUT_HANDLE: Handle
122+
SHORTCUT_ENABLE: Enable
123+
SHORTCUT_DISABLE: Disable
124+
SHORTCUT_EDIT: Edit
125+
SHORTCUT_CHANGE_UPLOAD: Change Upload Shortcut
126+
127+
# tray-page
128+
129+
WAIT_TO_UPLOAD: Wait to Upload
130+
ALREADY_UPLOAD: Already Upload
131+
132+
# upload-page
133+
134+
PICTURE_UPLOAD: Picture Upload
135+
DRAG_FILE_TO_HERE: Drag file to here, or
136+
CLICK_TO_UPLOAD: click to upload
137+
LINK_FORMAT: Link Format
138+
CUSTOM: Custom
139+
CLIPBOARD_PICTURE: Clipboard
140+
TIPS_DRAG_VALID_PICTURE_OR_URL: Drag valid picture or url to here
141+
TIPS_INPUT_URL: Input URL
142+
TIPS_HTTP_PREFIX: http:// or https://
143+
TIPS_INPUT_VALID_URL: Input valid URL
144+
145+
# plugins
146+
147+
PLUGIN_SEARCH_PLACEHOLDER: Search picgo plugins on npm, or click the button to view the awesome plugins list
148+
PLUGIN_INSTALL: Install
149+
PLUGIN_INSTALLING: Installing...
150+
PLUGIN_INSTALLED: Installed
151+
PLUGIN_DOING_SOMETHING: Doing...
152+
PLUGIN_LIST: Plugin List
153+
PLUGIN_IMPORT_LOCAL: Import Local Plugins
154+
155+
# tips
156+
157+
TIPS_REMOVE_LINK: This operation will remove the picture from the album, continue?
158+
TIPS_WILL_REMOVE_CHOOSED_IMAGES: This operation will remove the picture from the album, continue?
159+
TIPS_MUST_CONTAINS_URL: Must contains $url
160+
TIPS_NETWORK_ERROR: Network Error
161+
TIPS_NEED_RELOAD: Need Reload App
162+
TIPS_PLEASE_CHOOSE_LOG_LEVEL: Please choose log level
163+
TIPS_SET_SUCCEED: Set successfully
164+
TIPS_PLUGIN_NOT_GUI_IMPLEMENT: This plugin is not optimized for the GUI, continue?
165+
TIPS_CLICK_NOTIFICATION_TO_RELOAD: Click notification to reload app
166+
TIPS_GET_PLUGIN_LIST_FAILED: Get plugin list failed
167+
168+
# ---renderer i18n end---
169+
170+
# plugins
171+
PLUGIN_INSTALL_SUCCEED: Plugin install succeed
172+
PLUGIN_INSTALL_FAILED: Plugin install failed
173+
PLUGIN_UNINSTALL_SUCCEED: Plugin uninstall succeed
174+
PLUGIN_UNINSTALL_FAILED: Plugin uninstall failed
175+
PLUGIN_UPDATE_SUCCEED: Plugin update succeed
176+
PLUGIN_UPDATE_FAILED: Plugin update failed
177+
PLUGIN_IMPORT_SUCCEED: Plugin import succeed
178+
PLUGIN_IMPORT_FAILED: Plugin import failed
179+
ENABLE_PLUGIN: Enable Plugin
180+
DISABLE_PLUGIN: Disable Plugin
181+
UNINSTALL_PLUGIN: Uninstall Plugin
182+
UPDATE_PLUGIN: Update Plugin
183+
184+
# tips
185+
TIPS_NOTICE: Tips
186+
TIPS_WARNING: Warning
187+
TIPS_ERROR: Error
188+
TIPS_INSTALL_NODE_AND_RELOAD_PICGO: Please install Node.js and restart PicGo to continue
189+
TIPS_PLUGIN_REMOVE_GALLERY_ITEM: Plugin is trying to remove some images from the album gallery, continue?
190+
TIPS_PLUGIN_OVERWRITE_GALLERY: Plugin is trying to overwrite the album gallery, continue?
191+
TIPS_UPLOAD_NOT_PICTURES: The latest clipboard item is not a picture
192+
TIPS_PICGO_CONFIG_FILE_BROKEN_WITH_DEFAULT: PicGo config file broken, has been restored to default
193+
TIPS_PICGO_CONFIG_FILE_BROKEN_WITH_BACKUP: PicGo config file broken, has been restored to backup
194+
TIPS_PICGO_BACKUP_FILE_VERSION: 'Backup file version: ${v}'
195+
TIPS_CUSTOM_CONFIG_FILE_PATH_ERROR: Custom config file parse error, please check the path content
196+
TIPS_SHORTCUT_MODIFIED_SUCCEED: Shortcut modified successfully
197+
TIPS_SHORTCUT_MODIFIED_CONFLICT: Shortcut conflict, please reset
198+
TIPS_CUSTOM_LINK_STYLE_MODIFIED_SUCCEED: Custom link style modified successfully
199+
TIPS_FIND_NEW_VERSION: Find new version ${v},update many new features, do you want to download the latest version?
200+
201+
# privacy
202+
PRIVACY: >
203+
204+
This software respects and protects the personal privacy of all users who use the service. In order to provide you with more accurate and better services, this software will use and collect some of your behavioral information in accordance with the provisions of this Privacy Policy. When you agree to the software service use agreement, you are deemed to have agreed to the entire content of this privacy policy. This privacy policy is an integral part of the software service use agreement, and it will not be used if you do not agree.
205+
This Agreement will be updated periodically.
206+
207+
1. Scope of application
208+
209+
210+
a) When you use this software, this software will record some information about your operation behavior of this software, including but not limited to the time-consuming, type, quantity and other information of your use of this software to upload files.
211+
212+
213+
2. Use of Information
214+
215+
216+
a) After obtaining your usage data, the software will upload it to the data analysis server so as to provide you with better services after analyzing the data.
217+
218+
219+
3. Information disclosure
220+
221+
222+
a) This software will not disclose your information to untrusted third parties.
223+
224+
225+
b) In accordance with the relevant provisions of the law, or the requirements of administrative or judicial institutions, disclose to third parties or administrative or judicial institutions;
226+
227+
228+
c) If you violate relevant Chinese laws, regulations or relevant rules, you need to disclose it to a third party;
229+
230+
231+
4. Information Security
232+
233+
234+
a) This software does not collect your personal information, key information and other private information, and the collected information is only used for improving the software, optimizing the experience, and understanding the daily activities of the software.
235+
PRIVACY_TIPS: Please agree the privacy policy to upload
236+
QUIT: Quit

0 commit comments

Comments
 (0)