feat: add translate

This commit is contained in:
liuyuanchuang
2026-01-24 13:53:50 +08:00
parent 6747205bd0
commit 42850c4460
12 changed files with 572 additions and 66 deletions

193
src/lib/translations.ts Normal file
View File

@@ -0,0 +1,193 @@
export const translations = {
en: {
common: {
upload: 'Upload',
history: 'History',
login: 'Login / Register',
logout: 'Logout',
loading: 'Loading...',
processing: 'Processing...',
cancel: 'Cancel',
copy: 'Copy',
copied: 'Copied!',
download: 'Download',
export: 'Export',
preview: 'Preview',
email: 'Email',
contactUs: 'Contact Us',
reward: 'Reward',
qqGroup: 'QQ Group (Click to Copy)',
guide: 'User Guide',
click: 'Click',
drop: 'Drop',
paste: 'Paste',
},
navbar: {
rewardTitle: 'WeChat Reward',
rewardThanks: 'Thank you for your support and encouragement ❤️',
rewardSubtitle: 'Your support is our motivation for continuous updates',
},
sidebar: {
title: 'Formula Recognize',
subtitle: 'Support handwriting and printed formulas',
uploadInstruction: 'Click, Drop, or Paste a file to start parsing',
pleaseLogin: 'Please login to view history',
noHistory: 'No history records',
noMore: 'No more records',
historyHeader: 'History',
},
uploadModal: {
title: 'Upload File',
supportFormats: 'Support JPG, PNG, PDF format',
},
resultPanel: {
waitingTitle: 'Waiting for recognition result',
waitingSubtitle: 'After uploading the file, Texpixel will automatically recognize and display the result here',
analyzing: 'Analyzing...',
waitingQueue: 'Waiting in queue...',
queueSubtitle: 'Your file is in the queue, please wait.',
processingSubtitle: 'Texpixel is processing your file, this may take a moment.',
markdown: 'Markdown',
},
auth: {
signIn: 'Login',
signUp: 'Register',
signInTitle: 'Login Account',
signUpTitle: 'Register Account',
email: 'Email',
password: 'Password',
error: 'Error',
genericError: 'An error occurred, please try again',
hasAccount: 'Already have an account? Login',
noAccount: 'No account? Register',
},
export: {
title: 'Export',
categories: {
code: 'Code',
image: 'Image',
file: 'File',
},
failed: 'Export failed, please try again',
imageFailed: 'Failed to generate image',
},
guide: {
next: 'Next',
prev: 'Back',
finish: 'Finish',
skip: 'Skip',
step1Title: 'Upload Area',
step1Content: 'Click or drag and drop your formula images/PDFs here to start recognition.',
step2Title: 'File History',
step2Content: 'Your recognized files will appear here. Login to sync across devices.',
step3Title: 'Preview Area',
step3Content: 'The original file you uploaded will be displayed here for comparison.',
step4Title: 'Recognition Result',
step4Content: 'The recognition results (Markdown/LaTeX) will be shown here.',
stepExportTitle: 'Export Result',
stepExportContent: 'You can export the recognition results to various formats such as Markdown, LaTeX, Word, or Image.',
},
alerts: {
taskTimeout: 'Task timeout: Recognition took too long.',
networkError: 'Task timeout or network error.',
uploadFailed: 'Upload failed',
}
},
zh: {
common: {
upload: '上传',
history: '历史记录',
login: '登录 / 注册',
logout: '退出登录',
loading: '加载中...',
processing: '处理中...',
cancel: '取消',
copy: '复制',
copied: '已复制!',
download: '下载',
export: '导出',
preview: '预览',
email: '邮箱',
contactUs: '联系我们',
reward: '赞赏',
qqGroup: 'QQ 群 (点击复制)',
guide: '使用引导',
click: '点击',
drop: '拖拽',
paste: '粘贴',
},
navbar: {
rewardTitle: '微信赞赏码',
rewardThanks: '感谢您的支持与鼓励 ❤️',
rewardSubtitle: '您的支持是我们持续更新的动力',
},
sidebar: {
title: '文档识别',
subtitle: '支持手写和印刷体文档识别',
uploadInstruction: '点击、拖拽或粘贴文件开始解析',
pleaseLogin: '请登录后查看历史记录',
noHistory: '暂无历史记录',
noMore: '没有更多记录了',
historyHeader: '历史记录',
},
uploadModal: {
title: '上传文件',
supportFormats: '支持 JPG, PNG 格式',
},
resultPanel: {
waitingTitle: '等待识别结果',
waitingSubtitle: '上传文件后TexPixel 将自动识别并在此显示结果',
analyzing: '解析中...',
waitingQueue: '排队中...',
queueSubtitle: '您的文件正在排队,请稍候。',
processingSubtitle: 'TexPixel 正在处理您的文件,请稍候。',
markdown: 'Markdown',
},
auth: {
signIn: '登录',
signUp: '注册',
signInTitle: '登录账号',
signUpTitle: '注册账号',
email: '邮箱',
password: '密码',
error: '错误',
genericError: '发生错误,请重试',
hasAccount: '已有账号?去登录',
noAccount: '没有账号?去注册',
},
export: {
title: '导出',
categories: {
code: '代码',
image: '图片',
file: '文件',
},
failed: '导出失败,请重试',
imageFailed: '生成图片失败',
},
guide: {
next: '下一步',
prev: '上一步',
finish: '完成',
skip: '跳过',
step1Title: '上传区域',
step1Content: '点击此处或将公式/文档图片 粘贴或者拖拽到这里开始识别。',
step2Title: '历史记录',
step2Content: '识别过的文件会显示在这里。登录后可以跨设备同步。',
step3Title: '预览区域',
step3Content: '这里会显示您上传的原始文件,方便对比。',
step4Title: '识别结果',
step4Content: '这里会显示识别出的 Markdown/LaTeX 结果。',
stepExportTitle: '导出结果',
stepExportContent: '您可以将识别结果导出为多种格式,如 Markdown、LaTeX、Word 或图片。',
},
alerts: {
taskTimeout: '任务超时:识别时间过长。',
networkError: '任务超时或网络错误。',
uploadFailed: '上传失败',
}
}
};
export type Language = 'en' | 'zh';
export type TranslationKey = typeof translations.en;