ca61ddfd5f
Gitea Auto Deploy / Deploy-Container (push) Successful in 50s
fix: update CopyImport component to handle profile selection and data validation feat: refactor EnkaImport component for better data parsing and error handling fix: improve FreeSRImport component with enhanced data validation and error management fix: update calcData helper functions to handle edge cases and improve robustness refactor: enhance converter functions for better data handling and validation feat: add validation to persisted stores using Zod schemas fix: update Zustand stores to use validated JSON storage for improved data integrity chore: add new Zod schemas for locale and connection persistence fix: ensure proper handling of optional fields in various data structures
28 lines
579 B
TypeScript
28 lines
579 B
TypeScript
import { getRequestConfig } from "next-intl/server";
|
|
import { cookies } from "next/headers";
|
|
|
|
const supportedLocales = new Set([
|
|
"en",
|
|
"vi",
|
|
"ja",
|
|
"ko",
|
|
"zh",
|
|
"de",
|
|
"es",
|
|
"fr",
|
|
"id",
|
|
"pt",
|
|
"ru",
|
|
"th",
|
|
]);
|
|
|
|
export default getRequestConfig( async () => {
|
|
const cookieLocale = (await cookies()).get("MYNEXTAPP_LOCALE")?.value;
|
|
const locale = cookieLocale && supportedLocales.has(cookieLocale) ? cookieLocale : "en";
|
|
|
|
return {
|
|
locale,
|
|
messages: (await import(`../messages/${locale}.json`)).default
|
|
}
|
|
})
|