From 2b57157502f88d1a8fc2bdf28dfa9071d22fd582 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 12 Oct 2023 12:01:10 -0400 Subject: [PATCH] backport PR 1604 --- docs/pages/resources/changelog.md | 1 + src/translations/zh-cn.ts | 39 +++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/translations/zh-cn.ts diff --git a/docs/pages/resources/changelog.md b/docs/pages/resources/changelog.md index e2a610d08..a9c885a82 100644 --- a/docs/pages/resources/changelog.md +++ b/docs/pages/resources/changelog.md @@ -21,6 +21,7 @@ New versions of Web Awesome are released as-needed and generally occur when a cr ## Next +- Added the Simplified Chinese translation [#1604] - Fixed a bug [in the localize dependency](https://github.com/shoelace-style/localize/issues/20) that caused underscores in language codes to throw a `RangeError` - Fixed a bug in `` that prevented exported tooltip parts from being styled [#1586] - Updated `@shoelace-style/localize` to 3.1.0 diff --git a/src/translations/zh-cn.ts b/src/translations/zh-cn.ts new file mode 100644 index 000000000..a77883810 --- /dev/null +++ b/src/translations/zh-cn.ts @@ -0,0 +1,39 @@ +import { registerTranslation } from '../utilities/localize.js'; +import type { Translation } from '../utilities/localize.js'; + +const translation: Translation = { + $code: 'zh-cn', + $name: '简体中文', + $dir: 'ltr', + + carousel: '跑马灯', + clearEntry: '清空', + close: '关闭', + copied: '已复制', + copy: '复制', + currentValue: '当前值', + error: '错误', + goToSlide: (slide, count) => `转到第 ${slide} 张幻灯片,共 ${count} 张`, + hidePassword: '隐藏密码', + loading: '加载中', + nextSlide: '下一张幻灯片', + numOptionsSelected: num => { + if (num === 0) return '未选择任何项目'; + if (num === 1) return '已选择 1 个项目'; + return `${num} 选择项目`; + }, + previousSlide: '上一张幻灯片', + progress: '进度', + remove: '删除', + resize: '调整大小', + scrollToEnd: '滚动至页尾', + scrollToStart: '滚动至页首', + selectAColorFromTheScreen: '从屏幕中选择一种颜色', + showPassword: '显示密码', + slideNum: slide => `幻灯片 ${slide}`, + toggleColorFormat: '切换颜色模式' +}; + +registerTranslation(translation); + +export default translation;