mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: add fa locale
This commit is contained in:
@@ -37,7 +37,7 @@ const appearanceFormSchema = z.object({
|
|||||||
theme: z.enum(["light", "dark", "system"], {
|
theme: z.enum(["light", "dark", "system"], {
|
||||||
required_error: "Please select a theme.",
|
required_error: "Please select a theme.",
|
||||||
}),
|
}),
|
||||||
language: z.enum(["en", "pl", "ru", "de", "zh-Hant", "zh-Hans"], {
|
language: z.enum(["en", "pl", "ru", "de", "zh-Hant", "zh-Hans", "fa"], {
|
||||||
required_error: "Please select a language.",
|
required_error: "Please select a language.",
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
@@ -84,7 +84,10 @@ export function AppearanceForm() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-2">
|
<CardContent className="space-y-2">
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
<form
|
||||||
|
onSubmit={form.handleSubmit(onSubmit)}
|
||||||
|
className="space-y-8"
|
||||||
|
>
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="theme"
|
name="theme"
|
||||||
@@ -92,9 +95,13 @@ export function AppearanceForm() {
|
|||||||
render={({ field }) => {
|
render={({ field }) => {
|
||||||
return (
|
return (
|
||||||
<FormItem className="space-y-1 ">
|
<FormItem className="space-y-1 ">
|
||||||
<FormLabel>{t("settings.appearance.theme")}</FormLabel>
|
<FormLabel>
|
||||||
|
{t("settings.appearance.theme")}
|
||||||
|
</FormLabel>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
{t("settings.appearance.themeDescription")}
|
{t(
|
||||||
|
"settings.appearance.themeDescription"
|
||||||
|
)}
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
@@ -106,26 +113,42 @@ export function AppearanceForm() {
|
|||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="[&:has([data-state=checked])>div]:border-primary">
|
<FormLabel className="[&:has([data-state=checked])>div]:border-primary">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RadioGroupItem value="light" className="sr-only" />
|
<RadioGroupItem
|
||||||
|
value="light"
|
||||||
|
className="sr-only"
|
||||||
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className="items-center rounded-md border-2 border-muted p-1 hover:bg-accent transition-colors cursor-pointer">
|
<div className="items-center rounded-md border-2 border-muted p-1 hover:bg-accent transition-colors cursor-pointer">
|
||||||
<img src="/images/theme-light.svg" alt="light" />
|
<img
|
||||||
|
src="/images/theme-light.svg"
|
||||||
|
alt="light"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="block w-full p-2 text-center font-normal">
|
<span className="block w-full p-2 text-center font-normal">
|
||||||
{t("settings.appearance.themes.light")}
|
{t(
|
||||||
|
"settings.appearance.themes.light"
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="[&:has([data-state=checked])>div]:border-primary">
|
<FormLabel className="[&:has([data-state=checked])>div]:border-primary">
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<RadioGroupItem value="dark" className="sr-only" />
|
<RadioGroupItem
|
||||||
|
value="dark"
|
||||||
|
className="sr-only"
|
||||||
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer">
|
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer">
|
||||||
<img src="/images/theme-dark.svg" alt="dark" />
|
<img
|
||||||
|
src="/images/theme-dark.svg"
|
||||||
|
alt="dark"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="block w-full p-2 text-center font-normal">
|
<span className="block w-full p-2 text-center font-normal">
|
||||||
{t("settings.appearance.themes.dark")}
|
{t(
|
||||||
|
"settings.appearance.themes.dark"
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -138,10 +161,15 @@ export function AppearanceForm() {
|
|||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer">
|
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer">
|
||||||
<img src="/images/theme-system.svg" alt="system" />
|
<img
|
||||||
|
src="/images/theme-system.svg"
|
||||||
|
alt="system"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span className="block w-full p-2 text-center font-normal">
|
<span className="block w-full p-2 text-center font-normal">
|
||||||
{t("settings.appearance.themes.system")}
|
{t(
|
||||||
|
"settings.appearance.themes.system"
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -158,9 +186,13 @@ export function AppearanceForm() {
|
|||||||
render={({ field }) => {
|
render={({ field }) => {
|
||||||
return (
|
return (
|
||||||
<FormItem className="space-y-1">
|
<FormItem className="space-y-1">
|
||||||
<FormLabel>{t("settings.appearance.language")}</FormLabel>
|
<FormLabel>
|
||||||
|
{t("settings.appearance.language")}
|
||||||
|
</FormLabel>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
{t("settings.appearance.languageDescription")}
|
{t(
|
||||||
|
"settings.appearance.languageDescription"
|
||||||
|
)}
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
<Select
|
<Select
|
||||||
@@ -173,14 +205,39 @@ export function AppearanceForm() {
|
|||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{[
|
{[
|
||||||
{ label: "English", value: "en" },
|
{
|
||||||
{ label: "Polski", value: "pl" },
|
label: "English",
|
||||||
{ label: "Русский", value: "ru" },
|
value: "en",
|
||||||
{ label: "Deutsch", value: "de" },
|
},
|
||||||
{ label: "繁體中文", value: "zh-Hant" },
|
{
|
||||||
{ label: "简体中文", value: "zh-Hans" }
|
label: "Polski",
|
||||||
|
value: "pl",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Русский",
|
||||||
|
value: "ru",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Deutsch",
|
||||||
|
value: "de",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "繁體中文",
|
||||||
|
value: "zh-Hant",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "简体中文",
|
||||||
|
value: "zh-Hans",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Persian",
|
||||||
|
value: "fa",
|
||||||
|
},
|
||||||
].map((preset) => (
|
].map((preset) => (
|
||||||
<SelectItem key={preset.label} value={preset.value}>
|
<SelectItem
|
||||||
|
key={preset.label}
|
||||||
|
value={preset.value}
|
||||||
|
>
|
||||||
{preset.label}
|
{preset.label}
|
||||||
</SelectItem>
|
</SelectItem>
|
||||||
))}
|
))}
|
||||||
@@ -191,7 +248,9 @@ export function AppearanceForm() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button type="submit">{t("settings.common.save")}</Button>
|
<Button type="submit">
|
||||||
|
{t("settings.common.save")}
|
||||||
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
locales: ["en", "pl", "ru", "de", "zh-Hant", "zh-Hans"],
|
locales: ["en", "pl", "ru", "de", "zh-Hant", "zh-Hans", "fa"],
|
||||||
localeDetection: false,
|
localeDetection: false,
|
||||||
},
|
},
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ const MyApp = ({
|
|||||||
process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID && (
|
process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID && (
|
||||||
<Script
|
<Script
|
||||||
src={process.env.NEXT_PUBLIC_UMAMI_HOST}
|
src={process.env.NEXT_PUBLIC_UMAMI_HOST}
|
||||||
data-website-id={process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID}
|
data-website-id={
|
||||||
|
process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -71,11 +73,11 @@ export default api.withTRPC(
|
|||||||
{
|
{
|
||||||
i18n: {
|
i18n: {
|
||||||
defaultLocale: "en",
|
defaultLocale: "en",
|
||||||
locales: ["en", "pl", "ru", "de", "zh-Hant", "zh-Hans"],
|
locales: ["en", "pl", "ru", "de", "zh-Hant", "zh-Hans", "fa"],
|
||||||
localeDetection: false,
|
localeDetection: false,
|
||||||
},
|
},
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
keySeparator: false,
|
keySeparator: false,
|
||||||
},
|
}
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
1
apps/dokploy/public/locales/fa/common.json
Normal file
1
apps/dokploy/public/locales/fa/common.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
45
apps/dokploy/public/locales/fa/settings.json
Normal file
45
apps/dokploy/public/locales/fa/settings.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"settings.common.save": "ذخیره",
|
||||||
|
"settings.server.domain.title": "دامنه سرور",
|
||||||
|
"settings.server.domain.description": "یک دامنه به برنامه سرور خود اضافه کنید.",
|
||||||
|
"settings.server.domain.form.domain": "دامنه",
|
||||||
|
"settings.server.domain.form.letsEncryptEmail": "ایمیل Let's Encrypt",
|
||||||
|
"settings.server.domain.form.certificate.label": "گواهینامه",
|
||||||
|
"settings.server.domain.form.certificate.placeholder": "یک گواهینامه انتخاب کنید",
|
||||||
|
"settings.server.domain.form.certificateOptions.none": "هیچکدام",
|
||||||
|
"settings.server.domain.form.certificateOptions.letsencrypt": "Let's Encrypt (پیشفرض)",
|
||||||
|
|
||||||
|
"settings.server.webServer.title": "وب سرور",
|
||||||
|
"settings.server.webServer.description": "وب سرور را بازنشانی یا پاک کنید.",
|
||||||
|
"settings.server.webServer.actions": "اقدامات",
|
||||||
|
"settings.server.webServer.reload": "بارگذاری مجدد",
|
||||||
|
"settings.server.webServer.watchLogs": "مشاهده گزارشها",
|
||||||
|
"settings.server.webServer.updateServerIp": "بهروزرسانی آیپی سرور",
|
||||||
|
"settings.server.webServer.server.label": "سرور",
|
||||||
|
"settings.server.webServer.traefik.label": "ترافیک",
|
||||||
|
"settings.server.webServer.traefik.modifyEnv": "ویرایش محیط",
|
||||||
|
"settings.server.webServer.storage.label": "فضا",
|
||||||
|
"settings.server.webServer.storage.cleanUnusedImages": "پاکسازی Image های بدون استفاده",
|
||||||
|
"settings.server.webServer.storage.cleanUnusedVolumes": "پاکسازی ولومهای بدون استفاده",
|
||||||
|
"settings.server.webServer.storage.cleanStoppedContainers": "پاکسازی کانتینرهای متوقفشده",
|
||||||
|
"settings.server.webServer.storage.cleanDockerBuilder": "پاکسازی بیلدر و سیستم داکر",
|
||||||
|
"settings.server.webServer.storage.cleanMonitoring": "پاکسازی پایش",
|
||||||
|
"settings.server.webServer.storage.cleanAll": "پاکسازی همه",
|
||||||
|
|
||||||
|
"settings.profile.title": "حساب کاربری",
|
||||||
|
"settings.profile.description": "جزئیات پروفایل خود را در اینجا تغییر دهید.",
|
||||||
|
"settings.profile.email": "ایمیل",
|
||||||
|
"settings.profile.password": "رمز عبور",
|
||||||
|
"settings.profile.avatar": "تصویر پروفایل",
|
||||||
|
|
||||||
|
"settings.appearance.title": "ظاهر",
|
||||||
|
"settings.appearance.description": "تم داشبورد خود را سفارشی کنید.",
|
||||||
|
"settings.appearance.theme": "تم",
|
||||||
|
"settings.appearance.themeDescription": "یک تم برای داشبورد خود انتخاب کنید",
|
||||||
|
"settings.appearance.themes.light": "روشن",
|
||||||
|
"settings.appearance.themes.dark": "تاریک",
|
||||||
|
"settings.appearance.themes.system": "سیستم",
|
||||||
|
"settings.appearance.language": "زبان",
|
||||||
|
"settings.appearance.languageDescription": "یک زبان برای داشبورد خود انتخاب کنید"
|
||||||
|
}
|
||||||
@@ -1,6 +1,14 @@
|
|||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
const SUPPORTED_LOCALES = ["en", "pl", "ru", "de", "zh-Hant", "zh-Hans"] as const;
|
const SUPPORTED_LOCALES = [
|
||||||
|
"en",
|
||||||
|
"pl",
|
||||||
|
"ru",
|
||||||
|
"de",
|
||||||
|
"zh-Hant",
|
||||||
|
"zh-Hans",
|
||||||
|
"fa",
|
||||||
|
] as const;
|
||||||
|
|
||||||
type Locale = (typeof SUPPORTED_LOCALES)[number];
|
type Locale = (typeof SUPPORTED_LOCALES)[number];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user