Skip to content

Commit

Permalink
update i18n and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
XZB-1248 committed Apr 12, 2022
1 parent e2941e0 commit be60ba4
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 29 deletions.
12 changes: 6 additions & 6 deletions README.ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
| 屏幕快照 ||||
| 关机 ||||
| 重启 ||||
| 休眠 || ||
| 睡眠 || ||
| 休眠 || ||
| 睡眠 || ||
| 注销 ||||
| 锁屏 ||||

Expand Down Expand Up @@ -117,13 +117,13 @@ $ ./build.server.sh

## 截图

![overview](./screenshots/overview.png)
![overview](./screenshots/overview.ZH.png)

![terminal](./screenshots/terminal.png)
![terminal](./screenshots/terminal.ZH.png)

![procmgr](./screenshots/procmgr.png)
![procmgr](./screenshots/procmgr.ZH.png)

![explorer](./screenshots/explorer.png)
![explorer](./screenshots/explorer.ZH.png)

---

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Only local installation are available yet.
| Screenshot ||||
| Shutdown ||||
| Reboot ||||
| Hibernate || ||
| Sleep || ||
| Hibernate || ||
| Sleep || ||
| Log off ||||
| Lock screen ||||

Expand Down
4 changes: 2 additions & 2 deletions client/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func reportWS(wsConn *common.Conn) error {
return err
}
if pack.Code != 0 {
return errors.New(`unknown error occurred`)
return errors.New(`${i18n|unknownError}`)
}
return nil
}
Expand All @@ -131,7 +131,7 @@ func checkUpdate(wsConn *common.Conn) error {
return err
}
if resp == nil {
return errors.New(`unknown error occurred`)
return errors.New(`${i18n|unknownError}`)
}
if resp.GetContentType() == `application/octet-stream` {
body := resp.Bytes()
Expand Down
11 changes: 5 additions & 6 deletions client/service/basic/basic_linux.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux
// +build linux

package basic
Expand All @@ -11,21 +12,19 @@ func init() {
}

func Lock() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Logoff() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Hibernate() error {
_, _, err := syscall.Syscall(syscall.SYS_REBOOT, syscall.LINUX_REBOOT_CMD_HALT, 0, 0)
return err
return syscall.Reboot(syscall.LINUX_REBOOT_CMD_HALT)
}

func Suspend() error {
_, _, err := syscall.Syscall(syscall.SYS_REBOOT, syscall.LINUX_REBOOT_CMD_SW_SUSPEND, 0, 0)
return err
return syscall.Reboot(syscall.LINUX_REBOOT_CMD_SW_SUSPEND)
}

func Restart() error {
Expand Down
16 changes: 8 additions & 8 deletions client/service/basic/basic_others.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !linux
// +build !windows
//go:build !linux && !windows
// +build !linux,!windows

package basic

Expand All @@ -9,25 +9,25 @@ func init() {
}

func Lock() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Logoff() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Hibernate() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Suspend() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Restart() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}

func Shutdown() error {
return errors.New(`the operation is not supported`)
return errors.New(`${i18n|operationNotSupported}`)
}
2 changes: 1 addition & 1 deletion client/service/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func UploadFile(path, trigger string, start, end int64) error {
`FileSize`: strconv.FormatInt(size, 10),
}
if size < end {
return errors.New(`Invalid file size.`)
return errors.New(`${i18n|invalidFileSize}`)
}
if end == 0 {
uploadReq.RawRequest.ContentLength = size - start
Expand Down
2 changes: 1 addition & 1 deletion client/service/screenshot/supported.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func GetScreenshot(trigger string) error {
writer := new(bytes.Buffer)
num := screenshot.NumActiveDisplays()
if num == 0 {
err := errors.New(`no display found`)
err := errors.New(`${i18n|noDisplayFound}`)
putScreenshot(trigger, err.Error(), nil)
return err
}
Expand Down
Binary file added screenshots/explorer.ZH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/explorer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/overview.ZH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/procmgr.ZH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/procmgr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/terminal.ZH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/terminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion web/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@
"fileUploadFailed": "Failed to upload file",
"screenshotFailed": "Failed to take screenshot",
"screenshotObtainFailed": "Failed to obtain screenshot",
"invalidFileRange": "Invalid file range"
"invalidFileRange": "Invalid file range",
"operationNotSupported": "Operation is not supported",
"noDisplayFound": "No display found"
}
4 changes: 3 additions & 1 deletion web/src/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,7 @@
"fileUploadFailed": "文件上传失败",
"screenshotFailed": "截屏失败",
"screenshotObtainFailed": "截屏读取失败",
"invalidFileRange": "文件范围错误"
"invalidFileRange": "文件范围错误",
"operationNotSupported": "不支持该操作",
"noDisplayFound": "设备未连接显示器"
}
2 changes: 1 addition & 1 deletion web/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function tsToTime(ts) {
let hours = Math.floor(ts / 3600);
ts %= 3600;
let minutes = Math.floor(ts / 60);
return `${String(hours) + i18n.t('hours') + String(minutes) + i18n.t('minutes')}`;
return `${String(hours) + i18n.t('hours') + ' ' + String(minutes) + i18n.t('minutes')}`;
}

function post(url, data, ext) {
Expand Down

0 comments on commit be60ba4

Please sign in to comment.