This commit is contained in:
1 parent
e3b792f5a3
commit
395b43081c
6 files changed
+2040
-4
No files matched your search
@@ -10,7 +10,7 @@ import { adminAction } from "@/lib/safe-action";
|
|||||||
import { ActionError, actionOk } from "@/lib/safe-action-shared";
|
import { ActionError, actionOk } from "@/lib/safe-action-shared";
|
||||||
|
|
||||||
const saveTranslationsSchema = z.object({
|
const saveTranslationsSchema = z.object({
|
||||||
locale: z.enum(["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"]),
|
locale: z.enum(["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr"]),
|
||||||
data: z.record(z.string(), z.unknown()),
|
data: z.record(z.string(), z.unknown()),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
|||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { TranslationsClient } from "../translations-client";
|
import { TranslationsClient } from "../translations-client";
|
||||||
|
|
||||||
const LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"] as const;
|
const LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr"] as const;
|
||||||
|
|
||||||
export default async function CmsTranslationsPage() {
|
export default async function CmsTranslationsPage() {
|
||||||
const messagesDir = path.join(process.cwd(), "messages");
|
const messagesDir = path.join(process.cwd(), "messages");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Input } from "@/components/ui/input";
|
|||||||
import { useServerAction } from "@/hooks/use-server-action";
|
import { useServerAction } from "@/hooks/use-server-action";
|
||||||
import { flattenObject, unflattenObject } from "@/lib/translations-utils";
|
import { flattenObject, unflattenObject } from "@/lib/translations-utils";
|
||||||
|
|
||||||
type Locale = "en" | "it" | "nl" | "de" | "fr" | "es" | "pt" | "pl" | "sv";
|
type Locale = "en" | "it" | "nl" | "de" | "fr" | "es" | "pt" | "pl" | "sv" | "tr";
|
||||||
|
|
||||||
const LOCALES: { code: Locale; label: string }[] = [
|
const LOCALES: { code: Locale; label: string }[] = [
|
||||||
{ code: "en", label: "EN" },
|
{ code: "en", label: "EN" },
|
||||||
@@ -20,6 +20,7 @@ const LOCALES: { code: Locale; label: string }[] = [
|
|||||||
{ code: "pt", label: "PT" },
|
{ code: "pt", label: "PT" },
|
||||||
{ code: "pl", label: "PL" },
|
{ code: "pl", label: "PL" },
|
||||||
{ code: "sv", label: "SV" },
|
{ code: "sv", label: "SV" },
|
||||||
|
{ code: "tr", label: "TR" },
|
||||||
];
|
];
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const LOCALES: { code: string; label: string; lang: string }[] = [
|
|||||||
{ code: "pt", label: "Português", lang: "pt" },
|
{ code: "pt", label: "Português", lang: "pt" },
|
||||||
{ code: "pl", label: "Polski", lang: "pl" },
|
{ code: "pl", label: "Polski", lang: "pl" },
|
||||||
{ code: "sv", label: "Svenska", lang: "sv" },
|
{ code: "sv", label: "Svenska", lang: "sv" },
|
||||||
|
{ code: "tr", label: "Türkçe", lang: "tr" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function LanguageSwitcher() {
|
export function LanguageSwitcher() {
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ import { getRequestConfig } from "next-intl/server";
|
|||||||
// i18n WITHOUT routing: the locale is chosen by a `NEXT_LOCALE` cookie (set by
|
// i18n WITHOUT routing: the locale is chosen by a `NEXT_LOCALE` cookie (set by
|
||||||
// the language switcher) rather than a URL segment, so every existing route and
|
// the language switcher) rather than a URL segment, so every existing route and
|
||||||
// the access-guard middleware keep working unchanged. English is the fallback.
|
// the access-guard middleware keep working unchanged. English is the fallback.
|
||||||
export const SUPPORTED_LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"] as const;
|
export const SUPPORTED_LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr"] as const;
|
||||||
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
|
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
|
||||||
export const DEFAULT_LOCALE: AppLocale = "en";
|
export const DEFAULT_LOCALE: AppLocale = "en";
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user