feat(i18n): add Russian locale - #58
Conversation
Add "ru" as a third locale alongside en/zh, with a full messages/ru.json translation (keys structurally identical to en.json; Russian plural categories expanded). Centralize locale-dependent presentation into src/i18n/locale-meta.ts, replacing ~40 `locale === "zh" ? A : B` ternaries that silently served English to any third locale. A missing lookup is now a compile error, so the next locale is nearly free. - routing: register "ru", export Locale type - middleware: derive admin regexes from routing.locales - SEO: hreflang alternates, OpenGraph locale, JSON-LD inLanguage, and date formatting all read from localeMeta - fonts: load Cyrillic subsets for body + OG rendering only on ru pages, keeping the extra glyphs off Latin/CJK pages - articles: content exists only in ARTICLE_LOCALES (en/zh); guard the article routes so /ru/<category>/<slug> 404s instead of hitting the enum-typed locale column and erroring; drop ru from article hreflang and the sitemap; hide the article nav sections in ru - sitemap/llms.txt: emit article URLs for ARTICLE_LOCALES only - move the home JSON-LD softwareDescription into messages; drop the unused starter-template `home` namespace and stale pl.json / lang-switcher.tsx Replace the fixed two/three-button language pill with a dropdown (LangSwitcher) that lists locales by native name, scaling past three languages. The ru OG share image falls back to /og-en.jpg until /og-ru.jpg is designed. Changelog release notes stay two-column (en/zh), so ru changelog bodies render in English inside an otherwise translated page.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (36)
📝 WalkthroughWalkthroughAdds Russian localization across the site, centralizes locale metadata and URL handling, introduces a language dropdown, validates article locales at runtime, updates localized SEO/schema output, and expands sitemap and LLM text generation to configured locales. ChangesRussian localization and locale infrastructure
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Visitor
participant LangSwitcher
participant Routing
participant LocaleMetadata
participant LocalizedPage
Visitor->>LangSwitcher: Open locale menu
LangSwitcher->>Routing: Replace pathname with selected locale
LocalizedPage->>LocaleMetadata: Resolve locale metadata and path prefix
LocalizedPage->>LocalizedPage: Render translations and localized SEO/schema
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add "ru" as a third locale alongside en/zh, with a full messages/ru.json translation (keys structurally identical to en.json; Russian plural categories expanded).
Centralize locale-dependent presentation into src/i18n/locale-meta.ts, replacing ~40
locale === "zh" ? A : Bternaries that silently served English to any third locale. A missing lookup is now a compile error, so the next locale is nearly free.homenamespace and stale pl.json / lang-switcher.tsxReplace the fixed two/three-button language pill with a dropdown (LangSwitcher) that lists locales by native name, scaling past three languages.
The ru OG share image falls back to /og-en.jpg until /og-ru.jpg is designed. Changelog release notes stay two-column (en/zh), so ru changelog bodies render in English inside an otherwise translated page.
Issue 😱:
Closes https://github.com/Skolaczk/next-starter/issues
What has been done ✅:
Screenshots/Videos 🎥:
N/A
Summary by CodeRabbit
New Features
Improvements
Bug Fixes