Skip to content

Commit

Permalink
perf(tips): modify tips
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc authored and ibuler committed Aug 20, 2020
1 parent 11a6ea6 commit d53cb7c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 32 deletions.
24 changes: 12 additions & 12 deletions cmd/locale/en_US/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -237,28 +237,28 @@ msgid "Command `%s` is forbidden"
msgstr ""

#. i18n.T
#: pkg/proxy/dbproxy.go:117
#: pkg/proxy/dbproxy.go:119
msgid "Connecting to Database %s %.1f"
msgstr ""

#. i18n.T
#: pkg/proxy/dbproxy.go:136
#: pkg/proxy/dbproxy.go:138
msgid "System user <%s> and database <%s> protocol are inconsistent."
msgstr ""

#. i18n.T
#: pkg/proxy/dbproxy.go:144
#: pkg/proxy/dbproxy.go:146
msgid "Database %s protocol client not installed."
msgstr ""

#. i18n.T
#: pkg/proxy/dbproxy.go:203
#: pkg/proxy/dbproxy.go:205
msgid "Create database session failed"
msgstr ""

#. i18n.T
#. i18n.T
#: pkg/proxy/dbproxy.go:241 pkg/proxy/dbswitch.go:183
#: pkg/proxy/dbproxy.go:243 pkg/proxy/dbswitch.go:183
msgid "Database connect idle more than %d minutes, disconnect"
msgstr ""

Expand All @@ -268,39 +268,39 @@ msgid "Database connection terminated by administrator"
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:69
#: pkg/proxy/k8sproxy.go:71
msgid "Connecting to Kubernetes %s %.1f"
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:88
#: pkg/proxy/k8sproxy.go:90
msgid "System user <%s> and kubernetes <%s> protocol are inconsistent."
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:96
#: pkg/proxy/k8sproxy.go:98
msgid "%s protocol client not installed."
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:104
#: pkg/proxy/k8sproxy.go:106
msgid "You don't have permission login %s"
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:112
#: pkg/proxy/k8sproxy.go:114
msgid "You get auth token failed"
msgstr ""

#. i18n.T
#: pkg/proxy/k8sproxy.go:157
#: pkg/proxy/k8sproxy.go:159
msgid "Create k8s session failed"
msgstr ""

#. i18n.T
#. i18n.T
#. i18n.T
#: pkg/proxy/k8sproxy.go:195 pkg/proxy/parser.go:150 pkg/proxy/proxy.go:184
#: pkg/proxy/k8sproxy.go:197 pkg/proxy/parser.go:150 pkg/proxy/proxy.go:184
msgid "Reuse SSH connections (%s@%s) [Number of connections: %d]"
msgstr ""

Expand Down
30 changes: 14 additions & 16 deletions cmd/locale/zh_CN/LC_MESSAGES/koko.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgstr ""
#: pkg/handler/app_database.go:102
#, fuzzy
msgid "Search: %s"
msgstr "搜索: %s"
msgstr "搜索%s"

#. i18n.T
#: pkg/handler/app_database.go:104
Expand Down Expand Up @@ -224,9 +224,7 @@ msgstr "用户名"
#: pkg/handler/session.go:196
#, fuzzy
msgid "Tips: Enter system user ID and directly login"
msgstr ""
"\n"
"提示:输入系统用户ID,登录资产[ %s(%s) ]\n"
msgstr "提示:输入系统用户ID直接登录"

#. i18n.T
#: pkg/handler/session.go:197
Expand Down Expand Up @@ -254,30 +252,30 @@ msgid "Command `%s` is forbidden"
msgstr "命令 `%s` 是被禁止的 ..."

#. i18n.T
#: pkg/proxy/dbproxy.go:117
#: pkg/proxy/dbproxy.go:119
#, fuzzy
msgid "Connecting to Database %s %.1f"
msgstr "开始连接数据库%s %.1f"

#. i18n.T
#: pkg/proxy/dbproxy.go:136
#: pkg/proxy/dbproxy.go:138
#, fuzzy
msgid "System user <%s> and database <%s> protocol are inconsistent."
msgstr "系统用户<%s>和资产<%s>协议不一致"

#. i18n.T
#: pkg/proxy/dbproxy.go:144
#: pkg/proxy/dbproxy.go:146
msgid "Database %s protocol client not installed."
msgstr "%s 协议的数据库客户端未安装"

#. i18n.T
#: pkg/proxy/dbproxy.go:203
#: pkg/proxy/dbproxy.go:205
msgid "Create database session failed"
msgstr "创建数据库会话失败"

#. i18n.T
#. i18n.T
#: pkg/proxy/dbproxy.go:241 pkg/proxy/dbswitch.go:183
#: pkg/proxy/dbproxy.go:243 pkg/proxy/dbswitch.go:183
#, fuzzy
msgid "Database connect idle more than %d minutes, disconnect"
msgstr "数据库连接空闲时间超过 %d 分钟,断开连接"
Expand All @@ -289,43 +287,43 @@ msgid "Database connection terminated by administrator"
msgstr "管理员中断数据库连接"

#. i18n.T
#: pkg/proxy/k8sproxy.go:69
#: pkg/proxy/k8sproxy.go:71
#, fuzzy
msgid "Connecting to Kubernetes %s %.1f"
msgstr "开始连接Kubernetes %s %.1f"

#. i18n.T
#: pkg/proxy/k8sproxy.go:88
#: pkg/proxy/k8sproxy.go:90
#, fuzzy
msgid "System user <%s> and kubernetes <%s> protocol are inconsistent."
msgstr "系统用户<%s>和kubernetes<%s>协议不一致"

#. i18n.T
#: pkg/proxy/k8sproxy.go:96
#: pkg/proxy/k8sproxy.go:98
#, fuzzy
msgid "%s protocol client not installed."
msgstr "%s 协议的数据库客户端未安装"

#. i18n.T
#: pkg/proxy/k8sproxy.go:104
#: pkg/proxy/k8sproxy.go:106
msgid "You don't have permission login %s"
msgstr "你无权限登陆%s"

#. i18n.T
#: pkg/proxy/k8sproxy.go:112
#: pkg/proxy/k8sproxy.go:114
msgid "You get auth token failed"
msgstr "你获取认证令牌失败"

#. i18n.T
#: pkg/proxy/k8sproxy.go:157
#: pkg/proxy/k8sproxy.go:159
#, fuzzy
msgid "Create k8s session failed"
msgstr "创建Kubernetes会话失败"

#. i18n.T
#. i18n.T
#. i18n.T
#: pkg/proxy/k8sproxy.go:195 pkg/proxy/parser.go:150 pkg/proxy/proxy.go:184
#: pkg/proxy/k8sproxy.go:197 pkg/proxy/parser.go:150 pkg/proxy/proxy.go:184
msgid "Reuse SSH connections (%s@%s) [Number of connections: %d]"
msgstr "复用SSH连接(%s@%s)[连接数量: %d]"

Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/app_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (k *K8sApplication) DisplayCurrentResult() {

func (k *K8sApplication) ProxyK8s(dbSelect model.K8sCluster) {
systemUsers := service.GetUserK8sSystemUsers(k.h.user.ID, dbSelect.ID)
defer k.h.term.SetPrompt("[k8s]> ")
defer k.h.term.SetPrompt("[K8S]> ")
systemUserSelect, ok := k.h.chooseSystemUser(systemUsers)
if !ok {
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (h *interactiveHandler) getK8sApp() Application {
engine: eng,
searchKeys: make([]string, 0),
}
h.term.SetPrompt("[k8s]> ")
h.term.SetPrompt("[K8S]> ")
return &app
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/handler/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ func (h *interactiveHandler) chooseSystemUser(systemUsers []model.SystemUser) (s
backTip := i18n.T("Back: B/b")
for {
utils.IgnoreErrWriteString(h.term, table.Display())
utils.IgnoreErrWriteString(h.term, selectTip)
utils.IgnoreErrWriteString(h.term, utils.WrapperString(selectTip, utils.Green))
utils.IgnoreErrWriteString(h.term, utils.CharNewLine)
utils.IgnoreErrWriteString(h.term, backTip)
utils.IgnoreErrWriteString(h.term, utils.WrapperString(backTip, utils.Green))
utils.IgnoreErrWriteString(h.term, utils.CharNewLine)
line, err := h.term.ReadLine()
if err != nil {
Expand Down

0 comments on commit d53cb7c

Please sign in to comment.