Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改成可以一鍵安裝or更新翻譯檔的方式 #9

Open
wants to merge 85 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
05df16b
🚧 一鍵更新20% (完成從Github直接取json下來
we684123 Mar 24, 2022
19bb09b
有個讚讚
we684123 Mar 26, 2022
e566dc8
🥰
we684123 Mar 26, 2022
6e2164a
📝 note
we684123 Mar 26, 2022
42ef0ac
✨ 可直接取代了,不用自己下載
we684123 Mar 26, 2022
7f56b0d
🔥 test.js
we684123 Mar 26, 2022
0cde626
✨ update.js 懶得打指令👌
we684123 Mar 26, 2022
40d361a
🐛 udate.js 改成能在IDE外部執行的
we684123 Mar 26, 2022
98f1a06
🔥 test5
we684123 Mar 26, 2022
0d5a0ea
Merge branch 'remote_json_replace_local' into dev
we684123 Mar 26, 2022
9efe22b
✨🍻 update.js 現在會自己去找要去帶的檔案(應該ㄅ
we684123 Mar 26, 2022
be4939d
old_update 確認能用
we684123 Mar 26, 2022
fc089e7
🐛 update.js 修正路徑錯誤 + log錯誤
we684123 Mar 26, 2022
e15d221
🔀 Merge branch 'check_os_and_replace' into dev
we684123 Mar 26, 2022
516296c
✨ 把 local_update.js 留下,最少可以在找不到 strings_path 時使用
we684123 Mar 26, 2022
f8ef2c1
🔥test
we684123 Mar 26, 2022
0c30500
⬆️ update.js 寫寫jsdoc
we684123 Mar 26, 2022
2961100
📝 更新 ReadMe
we684123 Mar 26, 2022
6237381
💄 update.bat 現在執行完會自己停下來給使用者看結果
we684123 Mar 26, 2022
bf4faf8
🔥note
we684123 Mar 26, 2022
c2e91b0
📝 ReadMe 新增 config.json 設定說明
we684123 Mar 26, 2022
34d9dc7
🔀 Merge branch 'dev'
we684123 Mar 26, 2022
c3967ac
合併遠端追蹤分支 'rogeraabbccdd/master'
we684123 May 18, 2022
99e74d0
📝 ReadMe update match version
we684123 May 18, 2022
914ca29
📝 ReadMe update match version
we684123 May 18, 2022
cca061a
🔧 config.json 8.3.3 → 8.4.0
we684123 May 18, 2022
9c91b2e
♻️ update.js update.bat 確認用的等待換成 node.js 版本
we684123 May 18, 2022
de94797
💄 update.js , local_update.js 改善一下文字
we684123 May 18, 2022
ae80e4a
🔧 新增 package.json (含pkg設定)
we684123 May 18, 2022
c931d3e
🚀 pkg for update_for_windows
we684123 May 18, 2022
ad197af
🚀 pkg for update_for_linux
we684123 May 18, 2022
8ef9bb8
🚀 pkg for update_for_macos
we684123 May 18, 2022
b260323
Merge branch 'Deploy_ing' into dev
we684123 May 18, 2022
8c0abb0
Merge branch 'dev'
we684123 May 18, 2022
fdc3bb0
📝 ReadMe 修正
we684123 May 18, 2022
c07bfd9
Merge branch 'dev'
we684123 May 18, 2022
1bd6f34
✨➕ 升級到 json5
we684123 May 24, 2022
e0b45f9
Merge branch 'update_to_json5' into dev
we684123 May 24, 2022
ceed11d
📝🔧 更新環境依賴
we684123 May 24, 2022
5ec8690
🐛🚨 修正 log 錯誤
we684123 May 24, 2022
bf0effb
🔧🚨 package.json
we684123 May 24, 2022
93b8081
合併遠端追蹤分支 'rogeraabbccdd/master' 到 dev
we684123 May 24, 2022
33d9dd2
📝 note
we684123 May 24, 2022
f6a6b2c
♻️🚨💄 update.js 修改同步的部份,比以前好看太多 , 修改 Linter 成 Perttier, 修改輸出畫面
we684123 May 25, 2022
805fc4e
🔥 local_update.js 不想支援了好麻煩
we684123 May 25, 2022
984287f
🔥🔧📝 README, config.json5 移除 local_strings_version 屬性
we684123 May 25, 2022
8a636be
🚨📝 note.md , README.md , update.js
we684123 May 25, 2022
5c4be35
♻️🐛 update.js inputAnyKeyToExit獨立出來 + 修正未安裝 GitKraken 時的應對
we684123 May 25, 2022
2335ff0
🐛 update.js 修正連帶 ./strings.json 也被翻譯的問題
we684123 May 25, 2022
493b29d
💡 update.js 補上 getGitkrakenVersion 的 jsdoc
we684123 May 25, 2022
dda7871
✨ 新增 restoreToEnglish 功能(用 ./strings.en.json 替換回來)
we684123 May 25, 2022
191e056
Merge branch 'add_restoreToEnglish' into dev
we684123 May 25, 2022
d7b8d9d
🐛 update.js 修復生成出的 strings.json 格式錯誤
we684123 May 25, 2022
fb75d69
🚀 pkg for update_for_windows
we684123 May 25, 2022
5510871
🚀 pkg for update_for_linux
we684123 May 25, 2022
6315721
🚀 pkg for update_for_macos
we684123 May 25, 2022
89fe0ab
🔀 Merge branch 'for_build_all_platform' into dev
we684123 May 25, 2022
115c773
✨ auto_ctrl_git_commit_and_push_build.py
we684123 May 25, 2022
1d73b64
🔀 將分支 'auto_ctrl_git_commit_and_push_build' 合併到 dev 中
we684123 May 25, 2022
6695bc2
🚚 autoCtrlGitToBuild
we684123 May 25, 2022
6741a15
💩
we684123 May 26, 2022
4031268
🐛 update.js 修復讀取 'config.json5' 失敗的問題
we684123 May 26, 2022
ddfddf7
Merge branch 'fix_pkg_import_bug' into dev
we684123 May 26, 2022
5e518c2
⬆️ package.json 綁定 "pkg": "5.5.2"
we684123 May 26, 2022
a453c36
.
we684123 May 26, 2022
77c6cb0
🐛 autoCtrlToBuild.py 修正指令錯誤
we684123 May 26, 2022
0ab8a54
Merge branch 'tforau' into dev
we684123 May 26, 2022
b9d9db4
🔥🔧 config.json5 移除 local_strings_version 屬性(先前忘了... 有機會研究怎麼rebase)
we684123 May 26, 2022
7594f37
♻️ 嘗試縮減編譯後的體積中...
we684123 May 26, 2022
2727e8a
🙈
we684123 May 26, 2022
3818340
🔧 新增 package-lock.json
we684123 May 26, 2022
f35fb60
✨🔧 package 修改,build_all_platform_best 新鮮上菜~
we684123 May 26, 2022
e2cee86
🔀 Merge branch 'try_best_node_version' into dev
we684123 May 26, 2022
607e5c1
✨ update.js 新增 預設config 功能
we684123 May 26, 2022
81ca4d5
🔥 舊的、體積大的88
we684123 May 26, 2022
190adff
🍱 update_for_windows
we684123 May 26, 2022
aba30ea
🍱 update_for_linux
we684123 May 26, 2022
332994f
🍱 update_for_macos
we684123 May 26, 2022
f76a846
🔀 Merge branch 'for_build_all_platfor' into dev
we684123 May 26, 2022
92d3fbc
📝 更新 ReadMe
we684123 May 26, 2022
966b7fd
🔥 autoCtrlGitToBuild.md
we684123 May 26, 2022
8249d76
🔀 Merge branch 'dev'
we684123 May 26, 2022
84352a8
🔧 package.json ,"node": ">=10.0.0"
we684123 May 27, 2022
40e3154
Bump json5 from 2.2.1 to 2.2.2
dependabot[bot] Jan 8, 2023
ebd1812
Merge pull request #1 from we684123/dependabot/npm_and_yarn/json5-2.2.2
we684123 Jul 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
64 changes: 48 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
# GitKraken 正體中文 (台灣) 翻譯

ℹ️ 目前支援版本: 8.5.0
[GitKraken](https://www.gitkraken.com/) 正體中文 (台灣) 翻譯補丁
目前以緩慢速度翻譯中,8.4.0 除部分 Npm 與 Yarn 指令說明外其他皆翻譯完畢
目前以緩慢速度翻譯中,8.5.0 除部分 Npm 與 Yarn 指令說明外其他皆翻譯完畢

![screenshot](./screenshot.png)

## 使用方法
- 目前支援版本: 8.4.0
- 至 [Release](https://github.com/rogeraabbccdd/GitKraken-zh-tw/releases) 下載 `strings.json`
- 取代檔案
- Windows: `%LOCALAPPDATA%\gitkraken\app-8.4.0\resources\app.asar.unpacked\src\strings.json`
- Mac: `/Applications/GitKraken.app/Contents/Resources/app.asar.unpacked/src/strings.json`
- Linux: `/usr/share/gitkraken/resources/app.asar.unpacked/src`
## 開發環境

1. 安裝 [Node.js](https://nodejs.org/en/)
2. 安裝下列模組

```sh
npm install --save request-promise
npm install --save json5
npm install --save pkg
```

## 使用及更新方法

不管是第一次安裝或更新後都可以直接照下面做

- 下載專案後打開資料夾,依照自己的作業系統直接執行`update_for_windows_12`、`update_for_linux_10`、`update_for_macos_10`,或終端機後執行 `node update.js`
- 重新開啟 GitKraken 後,至 Preference -> UI Customization -> Language 切換語言
![screenshot](./preferences.png)

## 更新翻譯檔格式
當新版本 GitKraken 發佈時,請使用 `update.js` 將翻譯檔更新為新版本的格式,避免使用時出現問題
- 安裝 [Node.js](https://nodejs.org/en/)
- 下載 `update.js` 到翻譯檔資料夾
- 將新版的英文 `strings.json` 重新命名為 `strings.en.json`
- 將未更新的中文翻譯檔 `strings.json` 放入資料夾
- 用終端機開啟翻譯檔資料夾,執行 `node update.js`
## 改壞了怎麼辦?
有裝 NodeJS了?
`restoreToEnglish.js` 或 `restoreToEnglish.bat` 是你的好選擇

沒有的話:
1. 下載 `strings.en.json` 並改名為 `strings.json`
2. 依你的 OS 把`strings.json`丟過去取代
- Windows: `%LOCALAPPDATA%\gitkraken\app-8.5.0\resources\app.asar.unpacked\src\strings.json`
- Mac: `/Applications/GitKraken.app/Contents/Resources/app.asar.unpacked/src/strings.json`
- Linux: `/usr/share/gitkraken/resources/app.asar.unpacked/src/strings.json`
3. 重開你的 GitKraken

## config.json5 設定

```json5
{
// 翻譯來源的倉庫,改成自己喜歡的作者就好
"remote_repo_url": "https://github.com/we684123/GitKraken-zh-tw",
// 直接獲取json的基本網址 (你應該不會碰到?
"usercontent_base_url":"https://raw.githubusercontent.com",
// 翻譯來源倉庫的分支名稱
"aims_branche": "master",
// 翻譯來源倉庫的原始英文語言JSON檔名稱
"remote_strings_en_name": "strings.en.json",
// 翻譯來源倉庫的中文語言JSON檔名稱
"remote_strings_tw_name": "strings.json"
}
```

## 翻譯參考

- [VSCode 繁體中文語言包](https://github.com/microsoft/vscode-loc/tree/master/i18n/vscode-language-pack-zh-hant)
- [k-skye 的 gitkraken-chinese](https://github.com/k-skye/gitkraken-chinese)
- [gitg 繁體中文 (台灣) 翻譯](https://gitlab.gnome.org/GNOME/gitg/-/blob/master/po/zh_TW.po)
Expand Down
1 change: 1 addition & 0 deletions autoCtrlGitToBuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python .\auto_ctrl_git_commit_and_push_build.py
27 changes: 27 additions & 0 deletions autoCtrlGitToBuild.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
from time import sleep

os.system(r'git branch for_build_all_platfor')
os.system(r'git checkout for_build_all_platfor')

os.system(r'npm run build_all_platform')
sleep(1)

os.system(r'git add .\update_for_windows.exe')
os.system(r'git commit -m "🚀 pkg for update_for_windows"')
os.system(r'git push --set-upstream origin for_build_all_platform')

os.system(r'git add .\update_for_linux')
os.system(r'git commit -m "🚀 pkg for update_for_linux"')
os.system(r'git push --set-upstream origin for_build_all_platform')

os.system(r'git add .\update_for_macos')
os.system(r'git commit -m "🚀 pkg for update_for_macos"')
os.system(r'git push --set-upstream origin for_build_all_platform')

# os.system(r'git checkout dev')
# command = ("git merge for_build_all_platform --no-ff -m " +
# "🔀 Merge branch 'for_build_all_platform' into dev")
# os.system(command)
#
# os.system(r'git branch -d for_build_all_platform')
12 changes: 12 additions & 0 deletions config.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// 翻譯來源的倉庫,改成自己喜歡的作者就好
"remote_repo_url": "https://github.com/rogeraabbccdd/GitKraken-zh-tw",
// 直接獲取json的基本網址 (你應該不會碰到?
"usercontent_base_url": "https://raw.githubusercontent.com",
// 翻譯來源倉庫的分支名稱
"aims_branche": "master",
// 翻譯來源倉庫的原始英文語言JSON檔名稱
"remote_strings_en_name": "strings.en.json",
// 翻譯來源倉庫的中文語言JSON檔名稱
"remote_strings_tw_name": "strings.json"
}
12 changes: 12 additions & 0 deletions note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 待做

- eslint?
- git hook
- 重構取代過程
- 分出 functions?
- 自動生 pkg + git 分段 push
- 到底是要用 "資料夾方案" 還是 "Releases 方案"...
- docker 裝 gitkraken 直接測試?
- 開個專門部屬的分支?
- 寫個自動取代 we684123 -> rogeraabbccdd 的東西,然後有個專門的分支合併過去
- GitHub Actions?
Loading