Add Chinese language support (#259)
This commit is contained in:
parent
f9f442bab3
commit
450da7bb5d
@ -269,6 +269,7 @@ Partial internationalization (for non-admin, user-facing text) provided for a ha
|
|||||||
- `PT_BR`
|
- `PT_BR`
|
||||||
- `PT_PT`
|
- `PT_PT`
|
||||||
- `ID_ID`
|
- `ID_ID`
|
||||||
|
- `ZH_CN`
|
||||||
|
|
||||||
To add support for a new language, open a PR following instructions in [/src/i18n/index.ts](https://github.com/sambecker/exif-photo-blog/blob/main/src/i18n/index.ts), using [`US_EN`](https://github.com/sambecker/exif-photo-blog/blob/main/src/i18n/locales/us-en.ts) as reference.
|
To add support for a new language, open a PR following instructions in [/src/i18n/index.ts](https://github.com/sambecker/exif-photo-blog/blob/main/src/i18n/index.ts), using [`US_EN`](https://github.com/sambecker/exif-photo-blog/blob/main/src/i18n/locales/us-en.ts) as reference.
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import US_EN from './locales/us-en';
|
import US_EN from './locales/us-en';
|
||||||
import { enUS, id, ptBR, pt } from 'date-fns/locale';
|
import { enUS, id, ptBR, pt, zhCN } from 'date-fns/locale';
|
||||||
import { APP_LOCALE } from '@/app/config';
|
import { APP_LOCALE } from '@/app/config';
|
||||||
|
|
||||||
export type I18N = typeof US_EN;
|
export type I18N = typeof US_EN;
|
||||||
@ -24,6 +24,7 @@ const localeTextImports: Record<
|
|||||||
'pt-br': () => import('./locales/pt-br').then(m => m.default),
|
'pt-br': () => import('./locales/pt-br').then(m => m.default),
|
||||||
'pt-pt': () => import('./locales/pt-pt').then(m => m.default),
|
'pt-pt': () => import('./locales/pt-pt').then(m => m.default),
|
||||||
'id-id': () => import('./locales/id-id').then(m => m.default),
|
'id-id': () => import('./locales/id-id').then(m => m.default),
|
||||||
|
'zh-cn': () => import('./locales/zh-cn').then(m => m.default),
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDateFnLocale = (locale: string) => {
|
const getDateFnLocale = (locale: string) => {
|
||||||
@ -31,6 +32,7 @@ const getDateFnLocale = (locale: string) => {
|
|||||||
case 'id-id': return id;
|
case 'id-id': return id;
|
||||||
case 'pt-pt': return pt;
|
case 'pt-pt': return pt;
|
||||||
case 'pt-br': return ptBR;
|
case 'pt-br': return ptBR;
|
||||||
|
case 'zh-cn': return zhCN;
|
||||||
default: return enUS;
|
default: return enUS;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
116
src/i18n/locales/zh-cn.ts
Normal file
116
src/i18n/locales/zh-cn.ts
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
const TEXT = {
|
||||||
|
photo: {
|
||||||
|
photo: '照片',
|
||||||
|
photoPlural: '照片',
|
||||||
|
taken: '拍摄时间',
|
||||||
|
created: '创建时间',
|
||||||
|
updated: '更新时间',
|
||||||
|
copied: '照片链接已复制',
|
||||||
|
},
|
||||||
|
category: {
|
||||||
|
camera: '相机',
|
||||||
|
cameraPlural: '相机',
|
||||||
|
cameraTitle: '使用 {{camera}} 拍摄',
|
||||||
|
cameraShare: '使用 {{camera}} 拍摄的照片',
|
||||||
|
lens: '镜头',
|
||||||
|
lensPlural: '镜头',
|
||||||
|
tag: '标签',
|
||||||
|
tagPlural: '标签',
|
||||||
|
taggedPhotos: '已标记照片',
|
||||||
|
taggedPhrase: '标记为 {{tag}} 的照片',
|
||||||
|
taggedFavs: '收藏照片',
|
||||||
|
recipe: '预设',
|
||||||
|
recipePlural: '预设',
|
||||||
|
recipeShare: '{{recipe}} 预设照片',
|
||||||
|
film: '胶片',
|
||||||
|
filmPlural: '胶片',
|
||||||
|
filmShare: '使用 {{film}} 拍摄的照片',
|
||||||
|
focalLength: '焦距',
|
||||||
|
focalLengthPlural: '焦距',
|
||||||
|
focalLengthTitle: '焦距 {{focal}}',
|
||||||
|
focalLengthShare: '焦距 {{focal}} 拍摄的照片',
|
||||||
|
},
|
||||||
|
nav: {
|
||||||
|
home: '首页',
|
||||||
|
feed: '动态',
|
||||||
|
grid: '网格',
|
||||||
|
admin: '管理',
|
||||||
|
search: '搜索',
|
||||||
|
prev: '上一页',
|
||||||
|
prevShort: '上一页',
|
||||||
|
next: '下一页',
|
||||||
|
nextShort: '下一页',
|
||||||
|
},
|
||||||
|
cmdk: {
|
||||||
|
placeholder: '搜索照片、视图、设置...',
|
||||||
|
searching: '搜索中...',
|
||||||
|
noResults: '未找到结果',
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
'35mm': '35mm 等效焦距',
|
||||||
|
zoom: '放大',
|
||||||
|
sharePhoto: '分享照片',
|
||||||
|
recipeInfo: '预设信息',
|
||||||
|
recipeCopy: '复制预设文本',
|
||||||
|
download: '下载原始文件',
|
||||||
|
},
|
||||||
|
theme: {
|
||||||
|
theme: '主题',
|
||||||
|
system: '系统',
|
||||||
|
light: '浅色模式',
|
||||||
|
dark: '深色模式',
|
||||||
|
},
|
||||||
|
auth: {
|
||||||
|
signIn: '登录',
|
||||||
|
signOut: '退出',
|
||||||
|
email: '管理员邮箱',
|
||||||
|
password: '管理员密码',
|
||||||
|
invalidEmailPassword: '邮箱或密码错误',
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
uploadPhotos: '上传照片',
|
||||||
|
upload: '上传',
|
||||||
|
uploadPlural: '上传',
|
||||||
|
uploading: '上传中',
|
||||||
|
update: '更新',
|
||||||
|
updatePlural: '更新',
|
||||||
|
managePhotos: '管理照片',
|
||||||
|
manageCameras: '管理相机',
|
||||||
|
manageLenses: '管理镜头',
|
||||||
|
manageTags: '管理标签',
|
||||||
|
manageRecipes: '管理预设',
|
||||||
|
batchEdit: '批量编辑照片...',
|
||||||
|
batchEditShort: '批量编辑...',
|
||||||
|
batchExitEdit: '退出批量编辑',
|
||||||
|
appInsights: '应用分析',
|
||||||
|
appConfig: '应用配置',
|
||||||
|
edit: '编辑',
|
||||||
|
favorite: '收藏',
|
||||||
|
unfavorite: '取消收藏',
|
||||||
|
download: '下载',
|
||||||
|
sync: '同步',
|
||||||
|
delete: '删除',
|
||||||
|
deleteConfirm: '确定要删除 "{{photoTitle}}" 吗?',
|
||||||
|
},
|
||||||
|
onboarding: {
|
||||||
|
setupComplete: '设置完成!',
|
||||||
|
setupIncomplete: '完成设置',
|
||||||
|
setupSignIn: '登录以上传照片',
|
||||||
|
setupFirstPhoto: '添加您的第一张照片',
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
setupConfig: '通过编辑环境变量来更改站点名称和其他配置',
|
||||||
|
},
|
||||||
|
misc: {
|
||||||
|
loading: '加载中...',
|
||||||
|
finishing: '完成中...',
|
||||||
|
uploading: '上传中',
|
||||||
|
repo: '基于',
|
||||||
|
copyPhrase: '{{label}} 已复制',
|
||||||
|
},
|
||||||
|
utility: {
|
||||||
|
paginate: '第 {{index}} 页,共 {{count}} 页',
|
||||||
|
paginateAction: '{{action}} 第 {{index}} 页,共 {{count}} 页',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TEXT;
|
||||||
Loading…
Reference in New Issue
Block a user