From 7c074d25f7c4e5c44f4175545f5b30f26bb495db Mon Sep 17 00:00:00 2001 From: Quan Dong <604925267@qq.com> Date: Fri, 21 Jul 2023 16:24:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=F0=9F=8C=90=20Chinese=20translat?= =?UTF-8?q?ion=20(#441)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: tabris --- docs/keybindings/Keybindings_zh.md | 107 +++++++++++++++++++++++ pkg/i18n/chinese.go | 136 +++++++++++++++++++++++++++++ pkg/i18n/i18n.go | 1 + 3 files changed, 244 insertions(+) create mode 100644 docs/keybindings/Keybindings_zh.md create mode 100644 pkg/i18n/chinese.go diff --git a/docs/keybindings/Keybindings_zh.md b/docs/keybindings/Keybindings_zh.md new file mode 100644 index 00000000..8b1607dd --- /dev/null +++ b/docs/keybindings/Keybindings_zh.md @@ -0,0 +1,107 @@ +_This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go run scripts/cheatsheet/main.go generate` from the project root._ + +# Lazydocker 菜单 + +## 项目 + +
+  e: 编辑lazydocker配置
+  o: 打开lazydocker配置
+  m: 查看日志
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+
+ +## 容器 + +
+  d: 移除
+  e: 隐藏/显示已停止的容器
+  p: 暂停
+  s: 停止
+  r: 重新启动
+  a: attach
+  m: 查看日志
+  E: 执行shell
+  c: 运行预定义的自定义命令
+  b: 查看批量命令
+  w: 在浏览器中打开(第一个端口为http)
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+  /: 过滤列表
+
+ +## 服务 + +
+  u: 启动服务
+  d: 移除容器
+  s: 停止
+  p: 暂停
+  r: 重新启动
+  S: 启动项目
+  a: attach
+  m: 查看日志
+  U: 创建并启动容器
+  D: 停止并移除容器
+  R: 查看重启选项
+  c: 运行预定义的自定义命令
+  b: 查看批量命令
+  E: 执行shell
+  w: 在浏览器中打开(第一个端口为http)
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+  /: 过滤列表
+
+ +## 镜像 + +
+  c: 运行预定义的自定义命令
+  d: 移除镜像
+  b: 查看批量命令
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+  /: 过滤列表
+
+ +## 卷 + +
+  c: 运行预定义的自定义命令
+  d: 移除卷
+  b: 查看批量命令
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+  /: 过滤列表
+
+ +## 网络 + +
+  c: 运行预定义的自定义命令
+  d: 移除网络
+  b: 查看批量命令
+  enter: 聚焦主面板
+  [: 上一个选项卡
+  ]: 下一个选项卡
+  /: 过滤列表
+
+ +## 主要 + +
+  esc: 返回
+
+ +## 全局 + +
+  +: 下一个屏幕模式(正常/半屏/全屏)
+  _: 上一个屏幕模式
+
diff --git a/pkg/i18n/chinese.go b/pkg/i18n/chinese.go new file mode 100644 index 00000000..aa125f0b --- /dev/null +++ b/pkg/i18n/chinese.go @@ -0,0 +1,136 @@ +package i18n + +func chineseSet() TranslationSet { + return TranslationSet{ + PruningStatus: "修剪中", + RemovingStatus: "移除中", + RestartingStatus: "重启中", + StartingStatus: "启动中", + StoppingStatus: "停止中", + UppingServiceStatus: "升级服务中", + UppingProjectStatus: "升级项目中", + DowningStatus: "下架中", + PausingStatus: "暂停中", + RunningCustomCommandStatus: "正在运行自定义命令", + RunningBulkCommandStatus: "正在运行批量命令", + + NoViewMachingNewLineFocusedSwitchStatement: "没有匹配 newLineFocused switch 语句的视图", + + ErrorOccurred: "发生错误!请在 https://github.com/jesseduffield/lazydocker/issues 上创建一个问题", + ConnectionFailed: "无法连接到 Docker 客户端。您可能需要重新启动 Docker 客户端", + UnattachableContainerError: "容器不支持 attaching。您必须使用“-it”标志运行服务,或者在docker-compose.yml文件中使用`stdin_open: true,tty: true`", + WaitingForContainerInfo: "在 Docker 给我们更多关于容器的信息之前,无法继续。请几分钟后重试。", + CannotAttachStoppedContainerError: "您不能 attach 到已停止的容器,您需要先启动它(您可以用 'r' 键来执行此操作)(是的,我懒得为您自动执行此操作)(很酷的是,我可以通过错误消息与您进行一对一的通讯)", + CannotAccessDockerSocketError: "无法访问 Docker 套接字:unix:///var/run/docker.sock\n请以 root 用户身份运行 lazydocker 或阅读https://docs.docker.com/install/linux/linux-postinstall/", + CannotKillChildError: "等待三秒钟以停止子进程。可能有一个孤儿进程在您的系统上继续运行。", + + Donate: "捐赠", + Confirm: "确认", + + Return: "返回", + FocusMain: "聚焦主面板", + LcFilter: "过滤列表", + Navigate: "导航", + Execute: "执行", + Close: "关闭", + Quit: "退出", + Menu: "菜单", + MenuTitle: "菜单", + Scroll: "滚动", + OpenConfig: "打开lazydocker配置", + EditConfig: "编辑lazydocker配置", + Cancel: "取消", + Remove: "移除", + HideStopped: "隐藏/显示已停止的容器", + ForceRemove: "强制移除", + RemoveWithVolumes: "移除并删除卷", + RemoveService: "移除容器", + UpService: "启动服务", + Stop: "停止", + Pause: "暂停", + Restart: "重新启动", + Down: "关闭项目", + DownWithVolumes: "关闭包括卷的项目", + Start: "启动项目", + Rebuild: "重建", + Recreate: "重新创建", + PreviousContext: "上一个选项卡", + NextContext: "下一个选项卡", + // Attach: "连接/附加", + ViewLogs: "查看日志", + UpProject: "创建并启动容器", + DownProject: "停止并移除容器", + RemoveImage: "移除镜像", + RemoveVolume: "移除卷", + RemoveNetwork: "移除网络", + RemoveWithoutPrune: "移除但不删除未标记的父级", + RemoveWithoutPruneWithForce: "移除(强制)但不删除未标记的父级", + RemoveWithForce: "移除(强制)", + PruneContainers: "删除退出的容器", + PruneVolumes: "删除未使用的卷", + PruneNetworks: "删除未使用的网络", + PruneImages: "删除未使用的镜像", + StopAllContainers: "停止所有容器", + RemoveAllContainers: "删除所有容器(强制)", + ViewRestartOptions: "查看重启选项", + ExecShell: "执行shell", + RunCustomCommand: "运行预定义的自定义命令", + ViewBulkCommands: "查看批量命令", + FilterList: "过滤列表", + OpenInBrowser: "在浏览器中打开(第一个端口为http)", + SortContainersByState: "按状态排序容器", + + GlobalTitle: "全局", + MainTitle: "主要", + ProjectTitle: "项目", + ServicesTitle: "服务", + ContainersTitle: "容器", + StandaloneContainersTitle: "独立容器", + ImagesTitle: "镜像", + VolumesTitle: "卷", + NetworksTitle: "网络", + CustomCommandTitle: "自定义命令:", + BulkCommandTitle: "批量命令:", + ErrorTitle: "错误", + LogsTitle: "日志", + ConfigTitle: "配置", + EnvTitle: "环境变量", + DockerComposeConfigTitle: "Docker-Compose配置", + TopTitle: "系统资源管理", + StatsTitle: "统计信息", + CreditsTitle: "关于我们", + ContainerConfigTitle: "容器配置", + ContainerEnvTitle: "容器环境变量", + NothingToDisplay: "无内容显示", + NoContainerForService: "没有日志可以展示;该服务未关联任何容器", + CannotDisplayEnvVariables: "展示环境变量时出现问题", + + NoContainers: "没有容器", + NoContainer: "没有容器", + NoImages: "没有镜像", + NoVolumes: "没有卷", + NoNetworks: "没有网络", + NoServices: "没有服务", + + ConfirmQuit: "您确定要退出吗?", + ConfirmUpProject: "您确定要“up”的docker compose项目吗?", + MustForceToRemoveContainer: "您无法删除正在运行的容器,除非您强制执行。您想强制执行吗?", + NotEnoughSpace: "空间不足,无法渲染面板", + ConfirmPruneImages: "您确定要删除所有未使用的镜像吗?", + ConfirmPruneContainers: "您确定要删除所有停止的容器吗?", + ConfirmStopContainers: "您确定要停止所有容器吗?", + ConfirmRemoveContainers: "您确定要删除所有容器吗?", + ConfirmPruneVolumes: "您确定要删除所有未使用的卷吗?", + ConfirmPruneNetworks: "您确定要删除所有未使用的网络吗?", + StopService: "您确定要停止此服务的容器吗?", + StopContainer: "您确定要停止此容器吗?", + PressEnterToReturn: "按 enter 返回 lazydocker(您可以在配置文件中设置 `gui.returnImmediately: true` 来禁用此提示)", + + No: "否", + Yes: "是", + + LcNextScreenMode: "下一个屏幕模式(正常/半屏/全屏)", + LcPrevScreenMode: "上一个屏幕模式", + FilterPrompt: "筛选", + } +} diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 658fd67d..e90b717a 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -54,6 +54,7 @@ func GetTranslationSets() map[string]TranslationSet { "tr": turkishSet(), "en": englishSet(), "fr": frenchSet(), + "zh": chineseSet(), } }