mirror of
https://github.com/theoludwig/theoludwig.git
synced 2026-08-25 09:21:33 +02:00
build(deps): update latest
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"exports": {
|
||||
"./translations/*.json": "./src/translations/*.json",
|
||||
"./messages.d.ts": "./src/messages.d.ts",
|
||||
"./navigation": "./src/navigation.ts",
|
||||
"./request": "./src/request.ts",
|
||||
"./routing": "./src/routing.ts"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import { createNavigation } from "next-intl/navigation"
|
||||
|
||||
import { routing } from "./routing.ts"
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, getPathname, permanentRedirect } =
|
||||
createNavigation(routing)
|
||||
@@ -1,12 +1,13 @@
|
||||
import { hasLocale } from "next-intl"
|
||||
import { getRequestConfig } from "next-intl/server"
|
||||
import * as rootParams from "next/root-params"
|
||||
import { routing } from "./routing.ts"
|
||||
|
||||
import { LOCALE_DEFAULT } from "@repo/utils/constants"
|
||||
import { deepMerge } from "@repo/utils/objects"
|
||||
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
const requested = await requestLocale
|
||||
export default getRequestConfig(async ({ locale: localeOverride }) => {
|
||||
const requested = localeOverride ?? (await rootParams.locale())
|
||||
const locale = hasLocale(routing.locales, requested) ? requested : routing.defaultLocale
|
||||
|
||||
const userMessages = (await import(`./translations/${locale}.json`)).default
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
export function locale(): Promise<string | undefined>
|
||||
@@ -1,8 +1,5 @@
|
||||
import { createNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_DEFAULT, LOCALE_PREFIX } from "@repo/utils/constants"
|
||||
import { defineRouting } from "next-intl/routing"
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
|
||||
// Countries: https://github.com/umpirsky/country-list/blob/master/data/en/country.json
|
||||
// Country flag picture: https://purecatamphetamine.github.io/country-flag-icons/3x2/US.svg
|
||||
@@ -11,17 +8,8 @@ import type { Locale } from "@repo/utils/constants"
|
||||
// Locale code is a combination of ISO 639-1 language code and ISO 3166-1 country code.
|
||||
// For example, `fr-FR` is a locale code for French language in France.
|
||||
|
||||
export interface LocaleProps {
|
||||
params: Promise<{
|
||||
locale: Locale
|
||||
}>
|
||||
}
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: LOCALES,
|
||||
defaultLocale: LOCALE_DEFAULT,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, getPathname, permanentRedirect } =
|
||||
createNavigation(routing)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
"extends": "@repo/config-typescript/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"types": ["@total-typescript/ts-reset"]
|
||||
"types": ["@total-typescript/ts-reset"],
|
||||
"paths": {
|
||||
"next/root-params": ["./src/root-params.d.ts"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user