Add 12 more languages: ro, hu, cs, sk, da, no, el, bg, hr, sr, uk, ru
This commit is contained in:
1 parent
395b43081c
commit
efe467d352
19 files changed
+24436
-4
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 631 B |
Binary file not shown.
|
After Width: | Height: | Size: 577 B |
@@ -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", "pt", "pl", "sv", "tr"]),
|
||||
locale: z.enum(["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr", "ro", "hu", "cs", "sk", "da", "no", "el", "bg", "hr", "sr", "uk", "ru"]),
|
||||
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", "pt", "pl", "sv", "tr"] as const;
|
||||
const LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr", "ro", "hu", "cs", "sk", "da", "no", "el", "bg", "hr", "sr", "uk", "ru"] 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" | "pt" | "pl" | "sv" | "tr";
|
||||
type Locale = "en" | "it" | "nl" | "de" | "fr" | "es" | "pt" | "pl" | "sv" | "tr" | "ro" | "hu" | "cs" | "sk" | "da" | "no" | "el" | "bg" | "hr" | "sr" | "uk" | "ru";
|
||||
|
||||
const LOCALES: { code: Locale; label: string }[] = [
|
||||
{ code: "en", label: "EN" },
|
||||
@@ -21,6 +21,18 @@ const LOCALES: { code: Locale; label: string }[] = [
|
||||
{ code: "pl", label: "PL" },
|
||||
{ code: "sv", label: "SV" },
|
||||
{ code: "tr", label: "TR" },
|
||||
{ code: "ro", label: "RO" },
|
||||
{ code: "hu", label: "HU" },
|
||||
{ code: "cs", label: "CS" },
|
||||
{ code: "sk", label: "SK" },
|
||||
{ code: "da", label: "DA" },
|
||||
{ code: "no", label: "NO" },
|
||||
{ code: "el", label: "EL" },
|
||||
{ code: "bg", label: "BG" },
|
||||
{ code: "hr", label: "HR" },
|
||||
{ code: "sr", label: "SR" },
|
||||
{ code: "uk", label: "UK" },
|
||||
{ code: "ru", label: "RU" },
|
||||
];
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -16,6 +16,18 @@ const LOCALES: { code: string; label: string; lang: string }[] = [
|
||||
{ code: "pl", label: "Polski", lang: "pl" },
|
||||
{ code: "sv", label: "Svenska", lang: "sv" },
|
||||
{ code: "tr", label: "Türkçe", lang: "tr" },
|
||||
{ code: "ro", label: "Română", lang: "ro" },
|
||||
{ code: "hu", label: "Magyar", lang: "hu" },
|
||||
{ code: "cs", label: "Čeština", lang: "cs" },
|
||||
{ code: "sk", label: "Slovenčina", lang: "sk" },
|
||||
{ code: "da", label: "Dansk", lang: "da" },
|
||||
{ code: "no", label: "Norsk", lang: "no" },
|
||||
{ code: "el", label: "Ελληνικά", lang: "el" },
|
||||
{ code: "bg", label: "Български", lang: "bg" },
|
||||
{ code: "hr", label: "Hrvatski", lang: "hr" },
|
||||
{ code: "sr", label: "Српски", lang: "sr" },
|
||||
{ code: "uk", label: "Українська", lang: "uk" },
|
||||
{ code: "ru", label: "Русский", lang: "ru" },
|
||||
];
|
||||
|
||||
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", "pt", "pl", "sv", "tr"] as const;
|
||||
export const SUPPORTED_LOCALES = ["en", "it", "nl", "de", "fr", "es", "pt", "pl", "sv", "tr", "ro", "hu", "cs", "sk", "da", "no", "el", "bg", "hr", "sr", "uk", "ru"] 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
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
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
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