diff --git a/i18n/en_US.json b/i18n/en_US.json index a5f6f62..f5afa17 100644 --- a/i18n/en_US.json +++ b/i18n/en_US.json @@ -105,6 +105,8 @@ "start-get": "START [go get]", "get-succ": "[go get] SUCCESS", "get-error": "[go get] ERROR", + "start-git_clone": "START [git clone]", + "git_clone-done": "[git clone] DONE", "check_version": "Checking update", "new_version_available": "new version available", "go_env": "Go", diff --git a/i18n/ja_JP.json b/i18n/ja_JP.json index eb89945..adc9794 100644 --- a/i18n/ja_JP.json +++ b/i18n/ja_JP.json @@ -105,6 +105,8 @@ "start-get": "[go get] 開始", "get-succ": "[go get] 成功", "get-error": "[go get] 失敗", + "start-git_clone": "[git clone] 開始", + "git_clone-done": "[git clone] 終わった", "check_version": "更新をチェック中", "new_version_available": "新しいバージョンがあります", "go_env": "Go", diff --git a/i18n/zh_CN.json b/i18n/zh_CN.json index a829b51..5763736 100644 --- a/i18n/zh_CN.json +++ b/i18n/zh_CN.json @@ -105,6 +105,8 @@ "start-get": "开始 [go get]", "get-succ": "[go get] 成功", "get-error": "[go get] 失败", + "start-git_clone": "开始 [git clone]", + "git_clone-done": "[git clone] 完成", "check_version": "正在检查更新", "new_version_available": "新版本可用", "go_env": "Go 环境", diff --git a/i18n/zh_TW.json b/i18n/zh_TW.json index 97748bd..3a03127 100644 --- a/i18n/zh_TW.json +++ b/i18n/zh_TW.json @@ -105,6 +105,8 @@ "start-get": "開始 [go get]", "get-succ": "[go get] 成功", "get-error": "[go get] 失败", + "start-git_clone": "開始 [git clone]", + "git_clone-done": "[git clone] 完成", "check_version": "正在檢查更新", "new_version_available": "可用新版本", "go_env": "Go 環境", diff --git a/output/get.go b/output/get.go index 312fd68..51106b8 100644 --- a/output/get.go +++ b/output/get.go @@ -45,7 +45,6 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) { locale := conf.GetUser(username).Locale var args map[string]interface{} - if err := json.NewDecoder(r.Body).Decode(&args); err != nil { logger.Error(err) data["succ"] = false diff --git a/scm/git/clone.go b/scm/git/clone.go index 6a8a22f..1336bd3 100644 --- a/scm/git/clone.go +++ b/scm/git/clone.go @@ -23,6 +23,8 @@ import ( "net/http" "os" "os/exec" + "outline/wide/conf" + "outline/wide/i18n" "github.com/b3log/wide/log" "github.com/b3log/wide/session" @@ -44,6 +46,7 @@ func CloneHandler(w http.ResponseWriter, r *http.Request) { return } username := httpSession.Values["username"].(string) + locale := conf.GetUser(username).Locale var args map[string]interface{} if err := json.NewDecoder(r.Body).Decode(&args); err != nil { @@ -85,7 +88,7 @@ func CloneHandler(w http.ResponseWriter, r *http.Request) { if nil != session.OutputWS[sid] { // display "START [git clone]" in front-end browser - channelRet["output"] = "git clone\n" + channelRet["output"] = "" + i18n.Get(locale, "start-git_clone").(string) + "\n" channelRet["cmd"] = "start-git_clone" wsChannel := session.OutputWS[sid] @@ -122,7 +125,7 @@ func CloneHandler(w http.ResponseWriter, r *http.Request) { logger.Debugf("User [%s, %s] 's running [git clone] [runningId=%d] has done: %s", username, sid, runningId, string(buf)) - channelRet["output"] = "git clone succ\n" + channelRet["output"] = "" + i18n.Get(locale, "git_clone-done").(string) + "\n" if nil != session.OutputWS[sid] { wsChannel := session.OutputWS[sid]