mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-22 23:31:12 +02:00
Translations: - Add complete Latvian translations (lv.json) - Remove Chinese translations (zh.json) - Update i18n routing to support en/lv locales - Update LanguageSwitcher component for Latvian - Update LocaleContext to use Latvian messages PR Review Improvements: - Create shared handleSessionExpired() utility in auth-utils.ts - Refactor use-user.ts, use-chats.ts, use-search-space.ts to use shared utility - Add session_expired error message to auth-errors.ts - Consistent redirect to /login?error=session_expired
22 lines
793 B
TypeScript
22 lines
793 B
TypeScript
import { createNavigation } from "next-intl/navigation";
|
|
import { defineRouting } from "next-intl/routing";
|
|
|
|
/**
|
|
* Internationalization routing configuration
|
|
* Defines supported locales and routing behavior for the application
|
|
*/
|
|
export const routing = defineRouting({
|
|
// A list of all locales that are supported
|
|
locales: ["en", "lv"],
|
|
|
|
// Used when no locale matches
|
|
defaultLocale: "en",
|
|
|
|
// The `localePrefix` setting controls whether the locale is included in the pathname
|
|
// 'as-needed': Only add locale prefix when not using the default locale
|
|
localePrefix: "as-needed",
|
|
});
|
|
|
|
// Lightweight wrappers around Next.js' navigation APIs
|
|
// that will consider the routing configuration
|
|
export const { Link, redirect, usePathname, useRouter, getPathname } = createNavigation(routing);
|