fix: 语言切换全面修复 —— 品牌层/主题首页/详情区块/404 全量 i18n(zh 矩阵 13/13)
- 站点品牌双语:每站 brandZh(品牌名/标语/hero/导航/页脚/搜索占位)由生成器写入 站点 messages 的 zh 覆盖;SiteChrome 改为 async getTranslations 按语言渲染 - 五套主题首页接线 siteHome/hero 命名空间(新增 wire-theme-i18n.py 一次性接线脚本, 仅处理组件函数体、hook 自动插入、hero 用 th 命名空间) - 详情页 Use cases/Good for/FAQ/reviewCta、用例与合集索引与详情、提交页、 对比页、Alternatives 表头与 FAQ 全部走 next-intl - 404 双语言:locale 内走 next-intl,根级按 Accept-Language - 修复 zh.json 中 84 处 zhXxx 旁挂键归位 + en.json 残留清理(i18n 694 键一致) - 回归:/zh 下 13 页全中文无英文残留、无横向溢出;五站 /zh lang=zh 全部正确
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
// 自动生成:[locale]/not-found.tsx 的薄路由
|
||||
export { default } from "@aidir/core/pages/[locale]/not-found";
|
||||
@@ -6,13 +6,25 @@ import { locales, defaultLocale, type Locale } from "@aidir/core/i18n.config";
|
||||
const brandMessages = {
|
||||
en: {
|
||||
seo: { home: {"title":"findai — The Minimal AI Tool Search Engine","description":"One search box, every AI tool. Describe what you're trying to do and find the right AI tool, ranked by the community.","ogImage":"/og-image.png"} },
|
||||
hero: { title: "findai — The Minimal AI Tool Search Engine", description: "One search box, every AI tool. Describe what you're trying to do and find the right AI tool, ranked by the community." },
|
||||
hero: { title: "What are you trying to do?", description: "One search box, every AI tool. Describe what you're trying to do and find the right AI tool, ranked by the community." },
|
||||
common: { brand: { name: "findai", tagline: "The minimal AI tool search engine." } },
|
||||
navigation: {
|
||||
main: { tools: "Search", blog: "Blog" },
|
||||
site: { items: ["Search","Use Cases","Rankings","Submit"], hrefs: ["/tools","/ai-tools-for","/rankings","/submit"] },
|
||||
},
|
||||
siteFooter: { groups: [{"title":"Search","links":[{"label":"All Tools","href":"/tools"},{"label":"Use Cases","href":"/ai-tools-for"},{"label":"Rankings","href":"/rankings"}]},{"title":"About","links":[{"label":"Submit a Tool","href":"/submit"},{"label":"Privacy","href":"/privacy"},{"label":"Terms","href":"/terms"}]}] },
|
||||
siteHeader: { searchPlaceholder: "What do you need?" },
|
||||
},
|
||||
zh: {
|
||||
seo: { home: {"title":"findai — 极简 AI 工具搜索引擎","description":"一个搜索框,找遍全部 AI 工具。说出你想做的事,社区排名替你选。","ogImage":"/og-image.png"} },
|
||||
hero: { title: "findai — 极简 AI 工具搜索引擎", description: "一个搜索框,找遍全部 AI 工具。说出你想做的事,社区排名替你选。" },
|
||||
common: { brand: { name: "findai", tagline: "The minimal AI tool search engine." } },
|
||||
hero: { title: "你想完成什么?", description: "一个搜索框,找遍全部 AI 工具。说出你想做的事,社区排名替你选。" },
|
||||
common: { brand: { name: "findai", tagline: "极简 AI 工具搜索引擎。" } },
|
||||
navigation: {
|
||||
main: { tools: "搜索", blog: "博客" },
|
||||
site: { items: ["搜索","用例","排行榜","提交"], hrefs: ["/tools","/ai-tools-for","/rankings","/submit"] },
|
||||
},
|
||||
siteFooter: { groups: [{"title":"搜索","links":[{"label":"All Tools","href":"/tools"},{"label":"Use Cases","href":"/ai-tools-for"},{"label":"Rankings","href":"/rankings"}]},{"title":"关于","links":[{"label":"Submit a Tool","href":"/submit"},{"label":"Privacy","href":"/privacy"},{"label":"Terms","href":"/terms"}]}] },
|
||||
siteHeader: { searchPlaceholder: "你需要什么?" },
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -2,6 +2,23 @@ import type { SiteConfig } from "@/kit/types";
|
||||
|
||||
// findai —— 独立站点的全部品牌/导航/页脚配置
|
||||
export const siteConfig: SiteConfig = {
|
||||
"brandZh": {
|
||||
"name": "findai",
|
||||
"tagline": "极简 AI 工具搜索引擎。",
|
||||
"headline": "你想完成什么?",
|
||||
"subheadline": "",
|
||||
"nav": [
|
||||
"搜索",
|
||||
"用例",
|
||||
"排行榜",
|
||||
"提交"
|
||||
],
|
||||
"footer": [
|
||||
"搜索",
|
||||
"关于"
|
||||
],
|
||||
"searchPlaceholder": "你需要什么?"
|
||||
},
|
||||
"accent": "260 70% 52%",
|
||||
"port": 3005,
|
||||
"brand": {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// 自动生成:站点首页组件(源自底座 minimal 形态,品牌来自 @/site/brand)
|
||||
import { siteConfig } from "@/site/brand";
|
||||
import { Search } from "lucide-react";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { ToolCardGrid } from "@/components/tool-card";
|
||||
import { LocaleLink } from "@/components/locale-link";
|
||||
import { getHomeDataSafe } from "@/kit/home-data";
|
||||
@@ -44,6 +45,8 @@ const popularSearches = [
|
||||
];
|
||||
|
||||
async function SiteHome({ locale }: { locale: string }) {
|
||||
const t = await getTranslations("siteHome");
|
||||
const th = await getTranslations("hero");
|
||||
const data = await getHomeDataSafe(6);
|
||||
|
||||
return (
|
||||
@@ -63,7 +66,7 @@ async function SiteHome({ locale }: { locale: string }) {
|
||||
<input
|
||||
name="search"
|
||||
autoFocus
|
||||
placeholder="I need to create marketing videos..."
|
||||
placeholder={t("minimalPlaceholder")}
|
||||
className="h-14 w-full rounded-full border border-border bg-background pl-14 pr-6 text-base text-foreground shadow-lg shadow-black/[0.03] placeholder:text-muted-foreground focus:border-primary/50 focus:outline-none focus:ring-4 focus:ring-primary/10"
|
||||
aria-label="Search AI tools"
|
||||
/>
|
||||
@@ -95,7 +98,7 @@ async function SiteHome({ locale }: { locale: string }) {
|
||||
href="/rankings"
|
||||
className="text-xs font-medium text-muted-foreground hover:text-primary"
|
||||
>
|
||||
See full rankings
|
||||
{t("seeRankings")}
|
||||
</LocaleLink>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user