Add Portuguese, Polish, and Swedish language support with flags
Local Build and Deploy / deploy (push) Failing after 1m7s
Local Build and Deploy / deploy (push) Failing after 1m7s
This commit is contained in:
1 parent
0bf4a9367a
commit
e3b792f5a3
8 files changed
+6112
-4
No files matched your search
@@ -10,7 +10,7 @@ import { adminAction } from "@/lib/safe-action";
|
||||
import { ActionError, actionOk } from "@/lib/safe-action-shared";
|
||||
|
||||
const saveTranslationsSchema = z.object({
|
||||
locale: z.enum(["en", "it", "nl", "de", "fr", "es"]),
|
||||
locale: z.enum(["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"]),
|
||||
data: z.record(z.string(), z.unknown()),
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { TranslationsClient } from "../translations-client";
|
||||
|
||||
const LOCALES = ["en", "it", "nl", "de", "fr", "es"] as const;
|
||||
const LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"] as const;
|
||||
|
||||
export default async function CmsTranslationsPage() {
|
||||
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 { flattenObject, unflattenObject } from "@/lib/translations-utils";
|
||||
|
||||
type Locale = "en" | "it" | "nl" | "de" | "fr" | "es";
|
||||
type Locale = "en" | "it" | "nl" | "de" | "fr" | "es" | "pt" | "pl" | "sv";
|
||||
|
||||
const LOCALES: { code: Locale; label: string }[] = [
|
||||
{ code: "en", label: "EN" },
|
||||
@@ -17,6 +17,9 @@ const LOCALES: { code: Locale; label: string }[] = [
|
||||
{ code: "de", label: "DE" },
|
||||
{ code: "fr", label: "FR" },
|
||||
{ code: "es", label: "ES" },
|
||||
{ code: "pt", label: "PT" },
|
||||
{ code: "pl", label: "PL" },
|
||||
{ code: "sv", label: "SV" },
|
||||
];
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -12,6 +12,9 @@ const LOCALES: { code: string; label: string; lang: string }[] = [
|
||||
{ code: "fr", label: "Français", lang: "fr" },
|
||||
{ code: "es", label: "Español", lang: "es" },
|
||||
{ code: "it", label: "Italiano", lang: "it" },
|
||||
{ code: "pt", label: "Português", lang: "pt" },
|
||||
{ code: "pl", label: "Polski", lang: "pl" },
|
||||
{ code: "sv", label: "Svenska", lang: "sv" },
|
||||
];
|
||||
|
||||
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
|
||||
// the language switcher) rather than a URL segment, so every existing route and
|
||||
// the access-guard middleware keep working unchanged. English is the fallback.
|
||||
export const SUPPORTED_LOCALES = ["en", "it", "nl", "de", "fr", "es"] as const;
|
||||
export const SUPPORTED_LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv"] as const;
|
||||
export type AppLocale = (typeof SUPPORTED_LOCALES)[number];
|
||||
export const DEFAULT_LOCALE: AppLocale = "en";
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user