惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
U
Unit 42
B
Blog RSS Feed
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
腾讯CDC
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - 聂微东
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta

Show HN

GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap
GitHub - ws-rush/lingui-rr: React Router v8 framework-mod...
ws-rush · 2026-06-28 · via Show HN

React Router v8 framework-mode integration for Lingui.

Stand With Palestine Documentation npm version


lingui-rr is a specialized integration layer that bridges Lingui and React Router v8 (Framework Mode). It handles the complexities of internationalization (i18n), locale routing, detection, and state serialization with zero-friction types.

For complete documentation, guides, and API reference, visit lingui-rr.wusaby.com.

Key Features

  • 🌐 URL-Prefix & Context Modes: Route locales seamlessly via URL paths (e.g., /en/about vs /about with prefix hiding) or keep URLs clean using cookie/header detection.
  • Zero-Cast React Integration: Prevents React Router type widening, avoiding messy as LinguiState assertions on loader data.
  • 🔄 SSR & SPA Support: Optimizations and configurations for Server-Side Rendered (server: true) and client-only Single Page Apps (server: false).
  • 🛡️ Built-in Redirection & Fallbacks: Automatic validation of locale prefixes with regional fallbacks (e.g. en-US -> en and ar-PS -> ar) and unlocalized asset exclusion.
  • ⚙️ Pluggable Pipelines: Customizable detector and persistence flows (Cookies, Headers, Session Storage, localStorage, Navigator).

Installation

pnpm add lingui-rr @lingui/core @lingui/react
pnpm add -D @lingui/cli @lingui/conf @lingui/vite-plugin @lingui/format-po

Quick Preview

Define your router setup in a shared i18n file, including regional variations like Palestinian Arabic (ar-PS):

// app/lib/i18n.ts
import {
  createLinguiRouter,
  clientDetectors,
  clientPersistence,
} from 'lingui-rr'

export const i18n = createLinguiRouter({
  server: false,
  mode: 'url-prefix',
  defaultLocale: 'ar',
  locales: {
    ar: { label: 'العربية', dir: 'rtl' },
    'ar-PS': { label: 'العربية (فلسطين)', dir: 'rtl' },
    en: { label: 'English', dir: 'ltr' },
  },
  detection: [clientDetectors.cookie('locale'), clientDetectors.navigator()],
  persistence: [clientPersistence.cookie('locale')],
  catalogs: {
    ar: () => import('../locales/ar.po'),
    'ar-PS': () => import('../locales/ar.po'),
    en: () => import('../locales/en.po'),
  },
})

Integrate into app/root.tsx:

// app/root.tsx
import {
  createLinguiRootLoader,
  createLinguiClientMiddleware,
  LinguiRouterProvider,
} from 'lingui-rr'
import { Outlet, useLoaderData } from 'react-router'
import { i18n } from './lib/i18n'

export const clientMiddleware = [createLinguiClientMiddleware(i18n)]
export const clientLoader = createLinguiRootLoader(i18n)

export default function App() {
  const state = useLoaderData<typeof clientLoader>()
  return (
    <LinguiRouterProvider state={state}>
      <Outlet />
    </LinguiRouterProvider>
  )
}

Documentation

Full documentation is hosted at lingui-rr.wusaby.com. Please refer to the site for:

  • Getting Started & Concept Mental Model: Understand the middleware-loader-provider lifecycle.
  • Step-by-Step Tutorials:
    • SSR with URL Prefixes
    • Client-Only/SPA with URL Prefixes
    • SSR in Context Mode (unprefixed URLs)
    • Client-Only/SPA in Context Mode
  • Configuration Reference: Complete options for createLinguiRouter including ignored paths, fallback behaviors, and regional fallbacks.
  • API Reference: Detailed specifications for middleware factories, loaders, hooks (useLinguiRouter), actions (createLocaleAction), and path rewriting helpers (rewriteLocalePath).
  • Advanced Options & Integration: Custom cookie attributes, session persistence using React Router's SessionStorage, and catalog compiler formats.

Support Palestine 🇵🇸

We stand in solidarity with the people of Palestine. We condemn the ongoing genocide, military occupation, and humanitarian catastrophe. Learn more and find resources documenting the situation at stand-with-palestine.org and the names of the victims at visualizingpalestine.org.