update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-25 21:25:20 +08:00
parent 93b6f0bef0
commit d64a046f82
9 changed files with 487 additions and 153 deletions

View File

@ -18,53 +18,86 @@ type OtherLocale = Exclude<Locale, typeof DEFAULT_LOCALE>;
type TranslationEntry = Partial<Record<OtherLocale, string>>;
export const dict: Record<string, TranslationEntry> = {
// ── 导航 / Navigation ──
'About': { cn: '关于' },
'全部的 runway': { cn: '全部的 runway' },
'Contact': { cn: '联系' },
'Contact Us': { cn: '联系我们' },
'Home': { cn: '首页' },
'Latest Projects': { cn: '最新项目' },
'Login': { cn: '登录' },
'Portfolio': { cn: '作品集' },
'Runway Archive': { cn: '走秀档案' },
'Signup': { cn: '注册' },
'about': { cn: '关于' },
'全部的 runway': { cn: '全部的 runway' },
'contact': { cn: '联系' },
'contact us': { cn: '联系我们' },
'home': { cn: '首页' },
'latest projects': { cn: '最新项目' },
'login': { cn: '登录' },
'portfolio': { cn: '作品集' },
'runway archive': { cn: '走秀档案' },
'signup': { cn: '注册' },
// ── 控件 / Controls ──
'Back to Index': { cn: '返回首页' },
'Back to top': { cn: '回到顶部' },
'Close': { cn: '关闭' },
'Previous image': { cn: '上一张' },
'Next image': { cn: '下一张' },
'Previous': { cn: '上一组' },
'Next': { cn: '下一组' },
'back to index': { cn: '返回首页' },
'back to top': { cn: '回到顶部' },
'close': { cn: '关闭' },
'previous image': { cn: '上一张' },
'next image': { cn: '下一张' },
'previous': { cn: '上一组' },
'next': { cn: '下一组' },
// ── 错误 / Errors ──
'No article ID specified': { cn: '未指定文章 ID' },
'Failed to load article. Please refresh or try later.': { cn: '加载文章失败,请刷新或稍后再试' },
'Click image to zoom · Scroll to view · Esc to close': { cn: '点击图片放大 · 上下滚动查看 · Esc 关闭' },
'no article id specified': { cn: '未指定文章 ID' },
'failed to load article. please refresh or try later.': { cn: '加载文章失败,请刷新或稍后再试' },
'click image to zoom · scroll to view · esc to close': { cn: '点击图片放大 · 上下滚动查看 · Esc 关闭' },
// ── 页脚 / Footer ──
'© 2026 PORTFOLIO STUDIO. ALL RIGHTS RESERVED.': { cn: '© 2026 PORTFOLIO STUDIO. 保留所有权利。' },
'© 2026 portfolio studio. all rights reserved.': { cn: '© 2026 PORTFOLIO STUDIO. 保留所有权利。' },
// ── 页脚工具 / Footer tools ──
'Color Studio Tools': { cn: '色彩工作室工具' },
'AI Color Trend Generator': { cn: 'AI 色彩趋势生成器' },
'Photo Swatch Extractor': { cn: '图片色板提取器' },
'Upload': { cn: '上传' },
'Reset B&W Theme': { cn: '重置黑白主题' },
'Default': { cn: '默认' },
'color studio tools': { cn: '色彩工作室工具' },
'ai color trend generator': { cn: 'AI 色彩趋势生成器' },
'photo swatch extractor': { cn: '图片色板提取器' },
'upload': { cn: '上传' },
'reset b&w theme': { cn: '重置黑白主题' },
'default': { cn: '默认' },
// ── 页脚简介 / Manifesto ──
'Minimalist editorial portfolio documenting haute couture shows, backstage fittings, and street culture. Integrated with 2026 color forecast intelligence and AI palette generator.':
'minimalist editorial portfolio documenting haute couture shows, backstage fittings, and street culture. integrated with 2026 color forecast intelligence and ai palette generator.':
{ cn: '极简编辑风格作品集,记录高级定制秀场、后台试装与街头文化。集成 2026 色彩预测情报与 AI 调色板生成器。' },
// ── 登录态 / Auth ──
'Hi': { cn: '你好' },
'Logout': { cn: '退出' },
'Language': { cn: '语言' },
'Runway looks': {cn: '秀场造型'}
'hi': { cn: '你好' },
'logout': { cn: '退出' },
'language': { cn: '语言' },
'runway looks': { cn: '秀场造型' }
};
/** 把 {name} 形式的占位符替换成参数值。 */
@ -81,7 +114,7 @@ function interpolate(text: string, params?: Record<string, string | number>): st
export function translate(key: string, locale: Locale, params?: Record<string, string | number>): string {
if (locale === DEFAULT_LOCALE) return interpolate(key, params);
const localized = dict[key]?.[locale as OtherLocale];
const localized = dict[key.toLowerCase()]?.[locale as OtherLocale];
if (localized) return interpolate(localized, params);
if (import.meta.env.DEV) {