fix: 沙盒页英文换行 + Logo 多语言

- 沙盒页标题/副标题添加 truncate 防止英文换行
- Logo 使用 t.brand.name/suffix 实现中英切换(宇之然/Yuzhiran)
- 新增 brand 翻译键(zh: 宇之然, en: Yuzhiran)
This commit is contained in:
yuzhiran-dev
2026-05-25 11:07:40 +08:00
parent e64a874499
commit 25ebcdc622
4 changed files with 12 additions and 10 deletions
+7 -7
View File
@@ -306,20 +306,20 @@ function SandboxPage() {
return (
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div className="flex items-center justify-between mb-4">
<div className="flex items-center gap-3">
<div className="flex items-center justify-between mb-4 gap-3">
<div className="flex items-center gap-3 min-w-0 flex-shrink overflow-hidden">
<button onClick={() => setSessionsOpen(!sessionsOpen)}
className="lg:hidden p-2 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent">
className="lg:hidden p-2 text-muted-foreground hover:text-foreground rounded-lg hover:bg-accent flex-shrink-0">
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" />
</svg>
</button>
<div>
<h1 className="text-2xl font-bold text-foreground">{t.sandbox.title}</h1>
<p className="text-sm text-muted-foreground mt-0.5">{t.sandbox.subtitle}</p>
<div className="truncate">
<h1 className="text-2xl font-bold text-foreground truncate">{t.sandbox.title}</h1>
<p className="text-sm text-muted-foreground mt-0.5 truncate">{t.sandbox.subtitle}</p>
</div>
</div>
<div className="flex flex-wrap items-center gap-2 sm:gap-3">
<div className="flex items-center gap-2 sm:gap-3 flex-shrink-0">
<ModelSelector value={model} onChange={setModel} className="w-40 sm:w-48" />
{!isLoggedIn && (
<Link href="/auth"
+3 -3
View File
@@ -86,9 +86,9 @@ export function Header() {
>
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex items-center justify-between h-16">
<Link href="/" className="flex items-center gap-2 group">
<span className="text-2xl font-bold bg-gradient-to-r from-brand-600 to-brand-400 bg-clip-text text-transparent"></span>
<span className="text-lg text-muted-foreground hidden sm:inline">AI</span>
<Link href="/" className="flex items-center gap-2 group shrink-0">
<span className="text-2xl font-bold bg-gradient-to-r from-brand-600 to-brand-400 bg-clip-text text-transparent whitespace-nowrap">{t.brand.name}</span>
<span className="text-lg text-muted-foreground hidden sm:inline">{t.brand.suffix}</span>
</Link>
<nav className="hidden md:flex items-center gap-1">
+1
View File
@@ -16,6 +16,7 @@ const en: Translations = {
search: { title: 'Search Results', placeholder: 'Search courses, prompts, tools, articles...', emptyHint: 'Enter keywords to search', noResults: 'No results found for "{q}"', resultsCount: '{n} results found', groupCourse: 'Courses', groupPrompt: 'Prompts', groupTool: 'AI Tools', groupContent: 'Articles' },
tools: { title: 'AI Tools', desc: 'Curated AI tools to boost your productivity' },
discover: { desc: 'Explore trending content and curated picks', hotCourses: 'Hot Courses', hotPrompts: 'Trending Prompts', hotPosts: 'Popular Discussions', viewCount: '{n} views', likeCount: '{n} likes', postStats: '❤️ {likes} · 👁 {views}' },
brand: { name: 'Yuzhiran', suffix: 'AI' },
footer: { tagline: 'Empowering Everyone to Master AI', explore: 'Explore', about: 'About', aboutUs: 'About Us', privacy: 'Privacy Policy', terms: 'Terms of Service', aiAgreement: 'AI Service Agreement', contact: 'Contact', copyright: '© {year} Yuzhiran Technology Center. All rights reserved.', models: 'Models', aiTools: 'AI Tools', articles: 'Articles', skills: 'Skills' },
models: { title: 'AI Model Encyclopedia', desc: 'Compare mainstream LLMs to find the best fit', tableName: 'Model', tableProvider: 'Provider', tableCapabilities: 'Capabilities', tableContext: 'Context', tableMaxOutput: 'Max Output', tablePricing: 'Pricing', free: 'Free', recommended: 'Recommended', pricingFree: 'Free', pricingMixed: 'Free/Paid', pricingPaid: 'Paid', contextWindow: 'Context', maxOutput: 'Max Output' },
error: { title: 'Something went wrong', desc: 'Page failed to load. Please try again.', reload: 'Reload' },
+1
View File
@@ -14,6 +14,7 @@ const zh = {
search: { title: '搜索结果', placeholder: '搜索专题、提示词、工具、文章...', emptyHint: '输入关键词搜索', noResults: '未找到与 "{q}" 相关的结果', resultsCount: '找到 {n} 个结果', groupCourse: '专题', groupPrompt: '提示词', groupTool: 'AI 工具', groupContent: '文章' },
tools: { title: 'AI 工具库', desc: '收录优质 AI 工具,助力工作效率提升' },
discover: { desc: '探索热门内容和精选推荐', hotCourses: '热门课程', hotPrompts: '热门提示词', hotPosts: '热门讨论', viewCount: '{n} 浏览', likeCount: '{n} 点赞', postStats: '❤️ {likes} 点赞 · 👁 {views} 浏览' },
brand: { name: '宇之然', suffix: 'AI' },
footer: { tagline: '让每个人都能用好 AI', explore: '探索', about: '关于', aboutUs: '关于我们', privacy: '隐私政策', terms: '服务协议', aiAgreement: 'AI 服务协议', contact: '联系方式', copyright: '© {year} 北京宇之然科技中心 版权所有', models: '模型百科', aiTools: 'AI 工具', articles: '文章', skills: '技能' },
models: { title: 'AI 模型百科', desc: '收录主流大语言模型,全面对比各项参数', tableName: '模型名称', tableProvider: '提供商', tableCapabilities: '能力', tableContext: '上下文', tableMaxOutput: '最大输出', tablePricing: '价格', free: '免费', recommended: '推荐', pricingFree: '免费', pricingMixed: '免费/付费', pricingPaid: '付费', contextWindow: '上下文', maxOutput: '最大输出' },
error: { title: '出错了', desc: '页面加载失败,请稍后重试', reload: '重新加载' },