[Translation] add Simplified Chinese translation (#715)
* feat: add Simplified Chinese translations * feat: improve translation * feat: improve translation * feat: improve translation
This commit is contained in:
parent
f8e2ba5b3b
commit
d298c550cd
4 changed files with 103 additions and 1 deletions
|
@ -19,6 +19,7 @@ import { ErrorFallback } from '~components/ErrorFallback'
|
||||||
import messages_en from './translations/en.json'
|
import messages_en from './translations/en.json'
|
||||||
import messages_fr from './translations/fr.json'
|
import messages_fr from './translations/fr.json'
|
||||||
import messages_it from './translations/it.json'
|
import messages_it from './translations/it.json'
|
||||||
|
import messages_zh_cn from './translations/zh-cn.json'
|
||||||
|
|
||||||
const ErrorBoundary = _Errorboundary as any
|
const ErrorBoundary = _Errorboundary as any
|
||||||
|
|
||||||
|
@ -433,6 +434,7 @@ const InnerTldraw = React.memo(function InnerTldraw({
|
||||||
en: messages_en,
|
en: messages_en,
|
||||||
fr: messages_fr,
|
fr: messages_fr,
|
||||||
it: messages_it,
|
it: messages_it,
|
||||||
|
'zh-cn': messages_zh_cn
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultLanguage = settings.language ?? navigator.language.split(/[-_]/)[0]
|
const defaultLanguage = settings.language ?? navigator.language.split(/[-_]/)[0]
|
||||||
|
|
|
@ -20,6 +20,7 @@ export function LanguageMenu() {
|
||||||
{ label: 'English', code: 'en' },
|
{ label: 'English', code: 'en' },
|
||||||
{ label: 'Français', code: 'fr' },
|
{ label: 'Français', code: 'fr' },
|
||||||
{ label: 'Italiano', code: 'it' },
|
{ label: 'Italiano', code: 'it' },
|
||||||
|
{ label: 'Chinese - Simplified', code: 'zh-cn' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const handleChangeLanguage = React.useCallback(
|
const handleChangeLanguage = React.useCallback(
|
||||||
|
|
99
packages/tldraw/src/translations/zh-cn.json
Normal file
99
packages/tldraw/src/translations/zh-cn.json
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
{
|
||||||
|
"style.menu.color": "颜色",
|
||||||
|
"style.menu.fill": "填充",
|
||||||
|
"style.menu.dash": "边框",
|
||||||
|
"style.menu.size": "尺寸",
|
||||||
|
"style.menu.keep.open": "保持常开",
|
||||||
|
"style.menu.font": "字体",
|
||||||
|
"style.menu.align": "对齐",
|
||||||
|
"styles": "样式",
|
||||||
|
|
||||||
|
"zoom.in": "放大",
|
||||||
|
"zoom.out": "缩小",
|
||||||
|
"to": "缩放至",
|
||||||
|
"to.selection": "缩放选中",
|
||||||
|
"to.fit": "自适应缩放",
|
||||||
|
|
||||||
|
"menu.file": "文件",
|
||||||
|
"menu.edit": "编辑",
|
||||||
|
"menu.view": "视图",
|
||||||
|
"menu.preferences": "偏好",
|
||||||
|
"menu.sign.in": "登录",
|
||||||
|
"menu.sign.out": "登出",
|
||||||
|
"sponsored": "已赞助",
|
||||||
|
"become.a.sponsor": "成为赞助者",
|
||||||
|
"zoom.to.selection": "缩放选中",
|
||||||
|
"zoom.to.fit": "自适应缩放",
|
||||||
|
"zoom.to": "缩放至",
|
||||||
|
|
||||||
|
"preferences.dark.mode": "暗黑模式",
|
||||||
|
"preferences.focus.mode": "专注模式",
|
||||||
|
"preferences.debug.mode": "调试模式",
|
||||||
|
"preferences.show.grid": "显示网格",
|
||||||
|
"preferences.use.cad.selection": "使用 CAD 选择",
|
||||||
|
"preferences.keep.stylemenu.open": "保持样式菜单常开",
|
||||||
|
"preferences.always.show.snaps": "总是展示对齐线",
|
||||||
|
"preferences.rotate.handles": "旋转手柄",
|
||||||
|
"preferences.binding.handles": "捆绑手柄",
|
||||||
|
"preferences.clone.handles": "克隆手柄",
|
||||||
|
|
||||||
|
"undo": "撤销",
|
||||||
|
"redo": "重做",
|
||||||
|
"cut": "剪切",
|
||||||
|
"copy": "复制",
|
||||||
|
"paste": "粘贴",
|
||||||
|
"copy.as": "复制为",
|
||||||
|
"export.as": "导出为",
|
||||||
|
"select.all": "选中全部",
|
||||||
|
"select.none": "取消选中",
|
||||||
|
"delete": "删除",
|
||||||
|
|
||||||
|
"new.project": "新工程",
|
||||||
|
"open": "打开",
|
||||||
|
"save": "保存",
|
||||||
|
"save.as": "保存为",
|
||||||
|
"upload.media": "上传媒体文件",
|
||||||
|
|
||||||
|
"create.page": "创建页面",
|
||||||
|
"new.page": "新页面",
|
||||||
|
"page.name": "页面名称",
|
||||||
|
"duplicate": "复制",
|
||||||
|
"cancel": "取消",
|
||||||
|
"copy.invite.link": "复制邀请链接",
|
||||||
|
"create.multiplayer.project": "创建多人工程",
|
||||||
|
"copy.multiplayer.project": "复制到多人工程",
|
||||||
|
|
||||||
|
"select": "选择",
|
||||||
|
"eraser": "橡皮",
|
||||||
|
"draw": "画笔",
|
||||||
|
"arrow": "箭头",
|
||||||
|
"text": "文本",
|
||||||
|
"sticky": "便利贴",
|
||||||
|
"Rectangle": "矩形",
|
||||||
|
"Ellipse": "椭圆形",
|
||||||
|
"Triangle": "三角形",
|
||||||
|
"Line": "直线",
|
||||||
|
|
||||||
|
"rotate": "旋转",
|
||||||
|
"lock.aspect.ratio": "锁定宽高比",
|
||||||
|
"unlock.aspect.ratio": "解锁宽高比",
|
||||||
|
"group": "分组",
|
||||||
|
"ungroup": "取消分组",
|
||||||
|
"move.to.back": "置底",
|
||||||
|
"move.backward": "下移一层",
|
||||||
|
"move.forward": "上移一层",
|
||||||
|
"move.to.front": "置顶",
|
||||||
|
"reset.angle": "重置旋转角度",
|
||||||
|
"lock": "锁定",
|
||||||
|
"unlock": "解锁",
|
||||||
|
|
||||||
|
"move.to.page": "移动到页面",
|
||||||
|
"flip.horizontal": "水平翻转",
|
||||||
|
"flip.vertical": "垂直翻转",
|
||||||
|
"move": "移动",
|
||||||
|
"to.front": "置顶",
|
||||||
|
"forward": "上一层",
|
||||||
|
"backward": "下一层",
|
||||||
|
"back": "置底",
|
||||||
|
"language": "语言"
|
||||||
|
}
|
|
@ -76,7 +76,7 @@ export class TDEventHandler {
|
||||||
onShapeClone?: TLShapeCloneHandler
|
onShapeClone?: TLShapeCloneHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TDLanguage = 'en' | 'fr' | 'it'
|
export type TDLanguage = 'en' | 'fr' | 'it' | 'zh-cn'
|
||||||
|
|
||||||
// The shape of the TldrawApp's React (zustand) store
|
// The shape of the TldrawApp's React (zustand) store
|
||||||
export interface TDSnapshot {
|
export interface TDSnapshot {
|
||||||
|
|
Loading…
Reference in a new issue