feat(i18n): restrict public routes and metadata to enabled locales
- Add ENABLED_LOCALES configuration in i18n/links.js (currently ["pt"]) - Redirect inactive locale prefixes to /pt via 307 in middleware.js - Restrict root locale negotiation to active locales with fallback to pt - Hide LanguageSelector when only one locale is enabled - Generate sitemap, hreflang alternates, and og:locale only for active locales - Generate static SSG pages only for active locales in build - Adapt check:i18n and smoke-imagem.sh to validate active vs inactive locales Co-Authored-By: Antigravity <noreply@google.com>
This commit is contained in:
1 parent
3a1a095e97
commit
d479a8d361
9 files changed
+219
-79
No files matched your search
+3
-2
@@ -1,8 +1,9 @@
|
||||
import { defineRouting } from "next-intl/routing";
|
||||
import { ENABLED_LOCALES } from "./links";
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: ["pt", "en", "es", "fr", "de", "zh-CN"],
|
||||
defaultLocale: "en",
|
||||
locales: ENABLED_LOCALES,
|
||||
defaultLocale: ENABLED_LOCALES.includes("en") ? "en" : (ENABLED_LOCALES[0] || "pt"),
|
||||
localePrefix: "always",
|
||||
pathnames: {
|
||||
"/": "/",
|
||||
|
||||
Reference in new issue
Block a user