Skip to content

feat(i18n): add Russian locale - #58

Merged
mkdir700 merged 1 commit into
mainfrom
feat/ru-i18n
Jul 16, 2026
Merged

feat(i18n): add Russian locale#58
mkdir700 merged 1 commit into
mainfrom
feat/ru-i18n

Conversation

@mkdir700

@mkdir700 mkdir700 commented Jul 16, 2026

Copy link
Copy Markdown
Member

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// 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.

Issue 😱:

Closes https://github.com/Skolaczk/next-starter/issues

What has been done ✅:

  • [ ]

Screenshots/Videos 🎥:

N/A

Summary by CodeRabbit

  • New Features

    • Added full Russian localization across the landing page, downloads, comparisons, blog content, FAQs, and sponsor flows.
    • Added a language dropdown supporting English, Chinese, and Russian.
    • Locale-aware navigation now hides unavailable article links.
  • Improvements

    • Updated SEO descriptions and metadata for localized pages.
    • Improved localized fonts, dates, links, structured data, sitemaps, and content feeds.
    • Added safer handling for unsupported language routes.
  • Bug Fixes

    • Corrected localized Open Graph images, language metadata, and article URL generation.

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.
@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
uc-website Error Error Jul 16, 2026 8:07am

@mkdir700
mkdir700 merged commit 31aacb9 into main Jul 16, 2026
2 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cdff6f2f-4b0a-44e6-b265-78295b338a05

📥 Commits

Reviewing files that changed from the base of the PR and between 614a962 and 0e6fae1.

📒 Files selected for processing (36)
  • messages/en.json
  • messages/pl.json
  • messages/ru.json
  • messages/zh.json
  • src/__tests__/integration/landing-release-state.spec.tsx
  • src/__tests__/unit/navigation.spec.tsx
  • src/app/[locale]/blog/[slug]/opengraph-image.tsx
  • src/app/[locale]/blog/[slug]/page.tsx
  • src/app/[locale]/changelog/[version]/page.tsx
  • src/app/[locale]/changelog/page.tsx
  • src/app/[locale]/compare/[slug]/page.tsx
  • src/app/[locale]/download/page.tsx
  • src/app/[locale]/layout.tsx
  • src/app/[locale]/page.tsx
  • src/app/[locale]/sponsor/invite/[token]/page.tsx
  • src/app/[locale]/sponsor/page.tsx
  • src/app/[locale]/use-cases/[slug]/page.tsx
  • src/app/[locale]/whitepaper/page.tsx
  • src/app/llms-full.txt/route.ts
  • src/app/llms.txt/route.ts
  • src/app/sitemap.ts
  • src/components/article/ArticleHubLayout.tsx
  • src/components/article/ArticleLayout.tsx
  • src/components/article/MarkdownArticleLayout.tsx
  • src/components/landing/FaqSection.tsx
  • src/components/landing/Footer.tsx
  • src/components/landing/LangSwitcher.tsx
  • src/components/landing/Navigation.tsx
  • src/components/lang-switcher.tsx
  • src/components/og/OgFrame.tsx
  • src/i18n/locale-meta.ts
  • src/i18n/routing.ts
  • src/lib/article-content.ts
  • src/lib/fonts.ts
  • src/lib/og/fonts.ts
  • src/middleware.ts

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Russian localization and locale infrastructure

Layer / File(s) Summary
Locale metadata and rendering foundation
messages/en.json, messages/ru.json, messages/zh.json, src/i18n/locale-meta.ts, src/i18n/routing.ts, src/lib/article-content.ts, src/lib/fonts.ts, src/lib/og/fonts.ts, src/components/og/OgFrame.tsx, src/middleware.ts
Adds Russian messages and locale metadata, shared locale helpers, script-aware font selection, runtime article-locale validation, and routing-derived admin locale patterns.
Localized navigation and message coverage
src/components/landing/LangSwitcher.tsx, src/components/landing/Navigation.tsx, src/components/landing/FaqSection.tsx, src/components/landing/Footer.tsx, src/__tests__/unit/navigation.spec.tsx, src/__tests__/integration/landing-release-state.spec.tsx
Replaces language tabs with an accessible locale dropdown, filters article links by locale availability, centralizes landing URLs, and verifies message-key and locale coverage.
Article locale validation and metadata
src/app/[locale]/blog/[slug]/*, src/app/[locale]/compare/[slug]/page.tsx, src/app/[locale]/use-cases/[slug]/page.tsx, src/components/article/*
Expands article static generation to authored locales, rejects unsupported runtime locales, and derives article metadata, URLs, images, alternates, and schema languages from shared helpers.
Page SEO and locale-aware paths
src/app/[locale]/layout.tsx, src/app/[locale]/page.tsx, src/app/[locale]/download/page.tsx, src/app/[locale]/changelog/*, src/app/[locale]/sponsor/*, src/app/[locale]/whitepaper/page.tsx
Uses locale metadata for page SEO, Open Graph values, date formatting, schema languages, alternate links, breadcrumbs, and redirects.
Locale-aware generated content
src/app/llms.txt/route.ts, src/app/llms-full.txt/route.ts, src/app/sitemap.ts
Generates sitemap and LLM outputs for configured locales while restricting article routes to locales with authored content.

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
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ru-i18n

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mkdir700
mkdir700 deleted the feat/ru-i18n branch July 16, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant