feat: implement internationalization (i18n) support

This commit is contained in:
radishzzz 2025-01-18 00:01:25 +00:00
parent 32ffec8480
commit d6c98880d3
17 changed files with 247 additions and 18 deletions

View file

@ -1,30 +1,44 @@
export const language = {
zh: {
// Global Language Map
export const langMap: Record<string, string[]> = {
'zh': ['zh-CN'],
'zh-tw': ['zh-TW'],
'ja': ['ja-JP'],
'en': ['en-US'],
'es': ['es-ES'],
'ru': ['ru-RU'],
}
// Standard Language Code
export const langCode = Object.values(langMap).flat()
// Abbreviated Language Code
export const langPath = Object.keys(langMap).flat()
// UI Translation
export const ui = {
'zh': {
posts: '文章',
tags: '标签',
about: '关于',
},
tw: {
'zh-tw': {
posts: '文章',
tags: '標籤',
about: '關於',
},
ja: {
'ja': {
posts: '記事',
tags: 'タグ',
about: '概要',
},
en: {
'en': {
posts: 'Posts',
tags: 'Tags',
about: 'About',
},
es: {
'es': {
posts: 'Posts',
tags: 'Tags',
about: 'Sobre',
},
ru: {
'ru': {
posts: 'Посты',
tags: 'Теги',
about: 'О себе',