feat(i18n): improve i18n copy and add new translations

- Add new translation entries
- Fix several language files
This commit is contained in:
YiZixuan
2025-08-15 21:37:12 +08:00
parent 35fe0b9071
commit 40488a5a53
33 changed files with 116 additions and 34 deletions
@@ -7,6 +7,7 @@ import { StatusCards } from "./StatusCards";
import { ServiceFilters } from "./ServiceFilters";
import { ServicesTable } from "./ServicesTable";
import { AddServiceDialog } from "@/components/services/AddServiceDialog";
import { useLanguage } from "@/contexts/LanguageContext";
interface DashboardContentProps {
services: Service[];
@@ -15,6 +16,7 @@ interface DashboardContentProps {
}
export const DashboardContent = ({ services, isLoading, error }: DashboardContentProps) => {
const { t } = useLanguage();
const [filter, setFilter] = useState<string>("all");
const [searchTerm, setSearchTerm] = useState<string>("");
const [isAddDialogOpen, setIsAddDialogOpen] = useState<boolean>(false);
@@ -31,7 +33,7 @@ export const DashboardContent = ({ services, isLoading, error }: DashboardConten
return (
<div className="flex flex-col items-center justify-center h-full gap-4 text-foreground">
<p>Error loading service data.</p>
<Button onClick={() => window.location.reload()}>Retry</Button>
<Button onClick={() => window.location.reload()}>{t('retry')}</Button>
</div>
);
}
@@ -40,12 +42,12 @@ export const DashboardContent = ({ services, isLoading, error }: DashboardConten
<main className="flex-1 flex flex-col overflow-auto bg-background p-6 pb-0">
<div className="flex flex-col flex-1">
<div className="flex justify-between items-center mb-6">
<h2 className="text-2xl font-bold text-foreground">Overview</h2>
<h2 className="text-2xl font-bold text-foreground">{t('overview')}</h2>
<Button
className="text-primary-foreground"
onClick={() => setIsAddDialogOpen(true)}
>
<Plus className="w-4 h-4 mr-2" /> New Service
<Plus className="w-4 h-4 mr-2" /> {t('newService')}
</Button>
</div>
@@ -3,6 +3,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "@/components/ui/select";
import { Plus } from "lucide-react";
import { useLanguage } from "@/contexts/LanguageContext";
interface ServiceFiltersProps {
filter: string;
@@ -19,10 +20,11 @@ export const ServiceFilters = ({
setSearchTerm,
servicesCount
}: ServiceFiltersProps) => {
const { t } = useLanguage();
return (
<div className="mb-6 flex justify-between items-center">
<div className="flex items-center">
<h3 className="text-xl font-semibold mr-2 text-foreground">Currently Monitoring</h3>
<h3 className="text-xl font-semibold mr-2 text-foreground">{t('currentlyMonitoring')}</h3>
<span className="bg-secondary text-secondary-foreground px-2 py-0.5 rounded text-sm">
{servicesCount}
</span>
@@ -30,10 +32,10 @@ export const ServiceFilters = ({
<div className="flex space-x-4">
<Select value={filter} onValueChange={setFilter}>
<SelectTrigger className="w-40 bg-card border-border">
<SelectValue placeholder="All Types" />
<SelectValue placeholder={t('allTypes')} />
</SelectTrigger>
<SelectContent>
<SelectItem value="all">All Types</SelectItem>
<SelectItem value="all">{t('allTypes')}</SelectItem>
<SelectItem value="HTTP">HTTP</SelectItem>
<SelectItem value="PING">PING</SelectItem>
<SelectItem value="TCP">TCP</SelectItem>
@@ -43,7 +45,7 @@ export const ServiceFilters = ({
<div className="relative">
<Input
className="w-72 bg-card border-border"
placeholder="Search"
placeholder={t('search')}
value={searchTerm}
onChange={(e) => setSearchTerm(e.target.value)}
/>
@@ -9,6 +9,7 @@ import {
import { ServiceForm } from "./ServiceForm";
import { ScrollArea } from "@/components/ui/scroll-area";
import { useQueryClient } from "@tanstack/react-query";
import { useLanguage } from "@/contexts/LanguageContext";
interface AddServiceDialogProps {
open: boolean;
@@ -16,6 +17,7 @@ interface AddServiceDialogProps {
}
export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps) {
const { t } = useLanguage();
const queryClient = useQueryClient();
const handleSuccess = async () => {
// Immediately invalidate and refetch services data
@@ -32,9 +34,9 @@ export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps)
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-[700px] max-h-[90vh] flex flex-col">
<DialogHeader>
<DialogTitle className="text-xl">Create New Service</DialogTitle>
<DialogTitle className="text-xl">{t("createNewService")}</DialogTitle>
<DialogDescription>
Fill in the details to create a new service to monitor.
{t("createNewServiceDesc")}
</DialogDescription>
</DialogHeader>
<ScrollArea className="flex-1 pr-4 overflow-auto" style={{ height: "calc(80vh - 180px)" }}>
+2 -1
View File
@@ -2,7 +2,7 @@
import { AboutTranslations } from '../types/about';
export const aboutTranslations: AboutTranslations = {
aboutCheckcle: "Über Checkcle",
aboutCheckCle: "Über Checkcle",
systemDescription: "Checkcle ist ein Open-Source-Überwachungs-Stack, der Echtzeit-Einblicke in Server- und Dienstzustände, Vorfallmanagement und operative Transparenz bietet. Veröffentlicht unter der MIT-Lizenz.",
systemVersion: "Systemversion",
license: "Lizenz",
@@ -15,6 +15,7 @@ export const aboutTranslations: AboutTranslations = {
quickActions: "Schnelle Aktionen",
quickActionsDescription: "Greifen Sie schnell auf gängige Überwachungsvorgänge und -funktionen zu. Wählen Sie unten eine Aktion aus, um loszulegen.",
quickTips: "Schnelle Tipps",
releasedOn: "Veröffentlicht",
};
+3 -2
View File
@@ -6,9 +6,10 @@ export const commonTranslations: CommonTranslations = {
logout: "Abmelden",
language: "Sprache",
english: "Englisch",
khmer: "Khmer",
khmer: "ភាសាខ្មែរ",
german: "Deutsch",
simplifiedChinese: "Simplified Chinese",
japanese: "日本語",
simplifiedChinese: "简体中文",
goodMorning: "Guten Morgen",
goodAfternoon: "Guten Nachmittag",
goodEvening: "Guten Abend",
@@ -51,4 +51,5 @@ export const incidentTranslations: IncidentTranslations = {
configuration: 'Konfiguration',
failedToUpdateStatus: 'Fehler beim Aktualisieren des Status',
inProgress: 'In Bearbeitung',
enterRootCause: 'Grundursache eingeben',
};
@@ -10,4 +10,13 @@ export const servicesTranslations: ServicesTranslations = {
uptime: "Betriebszeit",
lastChecked: "Zuletzt überprüft",
noServices: "Keine Dienste entsprechen Ihren Filterkriterien.",
currentlyMonitoring: "Derzeit überwacht",
retry: "Wiederholen",
overview: "Überblick",
newService: "Neuer Dienst",
rowsPerPage: "Zeilen pro Seite",
search: "Suchen",
allTypes: "Alle Arten",
createNewService: "Neuen Service hinzufügen",
createNewServiceDesc: "Geben Sie detaillierte Informationen ein, um einen neuen zu erstellen, den Sie überwachen möchten.",
};
+2 -1
View File
@@ -112,6 +112,7 @@ export const sslTranslations: SSLTranslations = {
created: "Erstellt",
lastUpdated: "Zuletzt aktualisiert",
lastNotification: "Letzte Benachrichtigung",
collectionId: "Sammlungs-ID"
collectionId: "Sammlungs-ID",
noCertificatesFound: "Keine Zertifikate gefunden",
}
+2 -1
View File
@@ -2,7 +2,7 @@
import { AboutTranslations } from '../types/about';
export const aboutTranslations: AboutTranslations = {
aboutCheckcle: "About Checkcle",
aboutCheckCle: "About Checkcle",
systemDescription: "Checkcle is an open-source monitoring stack offering real-time insights into server and service health, incident management, and operational transparency. Released as MIT License.",
systemVersion: "System Version",
license: "License",
@@ -15,4 +15,5 @@ export const aboutTranslations: AboutTranslations = {
quickActions: "Quick Actions",
quickActionsDescription: "Access common monitoring operations and features quickly. Select an action below to get started.",
quickTips: "Quick Tips",
releasedOn: "Released On",
};
+4 -3
View File
@@ -5,10 +5,11 @@ export const commonTranslations: CommonTranslations = {
welcome: "Welcome",
logout: "Logout",
language: "Language",
english: "English",
khmer: "Khmer",
english: "Englisch",
khmer: "ភាសាខ្មែរ",
german: "Deutsch",
simplifiedChinese: "Simplified Chinese",
japanese: "日本語",
simplifiedChinese: "简体中文",
goodMorning: "Good morning",
goodAfternoon: "Good afternoon",
goodEvening: "Good evening",
@@ -52,4 +52,5 @@ export const incidentTranslations: IncidentTranslations = {
configuration: 'Configuration',
failedToUpdateStatus: 'Failed to update status',
inProgress: 'In Progress',
enterRootCause: 'Enter Root Cause',
};
+10 -1
View File
@@ -9,4 +9,13 @@ export const servicesTranslations: ServicesTranslations = {
uptime: "Uptime",
lastChecked: "Last Checked",
noServices: "No services match your filter criteria.",
};
currentlyMonitoring: "Currently Monitoring",
retry: "Retry",
overview: "Overview",
newService: "NewService",
rowsPerPage: "Rows Per Page",
search: "Search",
allTypes: "All Types",
createNewService: "Create New Service",
createNewServiceDesc: "Fill in the details to create a new service to monitor.",
};
+2 -1
View File
@@ -112,5 +112,6 @@ export const sslTranslations: SSLTranslations = {
created: "Created",
lastUpdated: "Last Updated",
lastNotification: "Last Notification",
collectionId: "Collection ID"
collectionId: "Collection ID",
noCertificatesFound: "No Certificates Found",
};
+2 -1
View File
@@ -1,7 +1,7 @@
import { AboutTranslations } from '../types/about';
export const aboutTranslations: AboutTranslations = {
aboutCheckcle: "Checkcleについて",
aboutCheckCle: "Checkcleについて",
systemDescription: "Checkcleは、サーバーとサービスの健全性に関するリアルタイム監視、インシデント管理、運用の透明性を提供するオープンソースの監視スタックです。MIT ライセンスの下で公開されています。",
systemVersion: "システムバージョン",
license: "ライセンス",
@@ -14,4 +14,5 @@ export const aboutTranslations: AboutTranslations = {
quickActions: "クイックアクション",
quickActionsDescription: "一般的な監視操作と機能に素早くアクセスできます。開始するには、以下のアクションを選択してください。",
quickTips: "クイックヒント",
releasedOn: "公開日",
};
+3 -3
View File
@@ -4,11 +4,11 @@ export const commonTranslations: CommonTranslations = {
welcome: "ようこそ",
logout: "ログアウト",
language: "言語",
english: "English",
khmer: "Khmer",
english: "Englisch",
khmer: "ភាសាខ្មែរ",
german: "Deutsch",
simplifiedChinese: "简体中文",
japanese: "日本語",
simplifiedChinese: "简体中文",
goodMorning: "おはようございます",
goodAfternoon: "こんにちは",
goodEvening: "こんばんは",
@@ -51,4 +51,5 @@ export const incidentTranslations: IncidentTranslations = {
configuration: '設定',
failedToUpdateStatus: 'ステータスの更新に失敗しました',
inProgress: '進行中',
enterRootCause: '原因を入力してください',
};
@@ -8,4 +8,13 @@ export const servicesTranslations: ServicesTranslations = {
uptime: "稼働時間",
lastChecked: "最終チェック",
noServices: "フィルタ条件に一致するサービスがありません。",
currentlyMonitoring: "現在監視中",
retry: "再試行",
overview: "概要",
newService: "新しいサービス",
rowsPerPage: "1ページあたりの行数",
search: "検索",
allTypes: "すべてのタイプ",
createNewService: "新しいサービスを作成",
createNewServiceDesc: "監視する新しいサービスを作成するには、詳細を入力してください。",
};
+2 -1
View File
@@ -111,5 +111,6 @@ export const sslTranslations: SSLTranslations = {
created: "作成日",
lastUpdated: "最終更新",
lastNotification: "最終通知",
collectionId: "コレクションID"
collectionId: "コレクションID",
noCertificatesFound: "証明書が見つかりません",
};
+2 -1
View File
@@ -2,7 +2,7 @@
import { AboutTranslations } from '../types/about';
export const aboutTranslations: AboutTranslations = {
aboutCheckcle: "អំពី Checkcle",
aboutCheckCle: "អំពី Checkcle",
systemDescription: "Checkcle គឺជាស្តាកការត្រួតពិនិត្យប្រភពបើកទូលាយដែលផ្តល់នូវការយល់ដឹងជាក់ស្តែងអំពីសុខភាពម៉ាស៊ីនមេ និងសេវាកម្ម, ការគ្រប់គ្រងឧបទ្ទវហេតុ, និងតម្លាភាពនៃប្រតិបត្តិការ។ ចេញផ្សាយជាអាជ្ញាបណ្ណ MIT។",
systemVersion: "កំណែប្រព័ន្ធ",
license: "អាជ្ញាបណ្ណ",
@@ -15,4 +15,5 @@ export const aboutTranslations: AboutTranslations = {
quickActions: "សកម្មភាពរហ័ស",
quickActionsDescription: "ចូលប្រើប្រតិបត្តិការត្រួតពិនិត្យ និងមុខងារទូទៅយ៉ាងរហ័ស។ ជ្រើសរើសសកម្មភាពខាងក្រោមដើម្បីចាប់ផ្តើម។",
quickTips: "គន្លឹះរហ័ស",
releasedOn: "បានចេញផ្សាយនៅថ្ងៃទី",
};
+3 -2
View File
@@ -5,9 +5,10 @@ export const commonTranslations: CommonTranslations = {
welcome: "សូមស្វាគមន៍",
logout: "ចាកចេញ",
language: "ភាសា",
english: "អង់គ្លេស",
khmer: "ខ្មែរ",
english: "Englisch",
khmer: "ភាសាខ្មែរ",
german: "Deutsch",
japanese: "日本語",
simplifiedChinese: "简体中文",
goodMorning: "អរុណសួស្តី",
goodAfternoon: "ទិវាសួស្តី",
@@ -52,4 +52,5 @@ export const incidentTranslations: IncidentTranslations = {
configuration: "ការកំណត់រចនាសម្ព័ន្ធ",
failedToUpdateStatus: "បរាជ័យក្នុងការធ្វើបច្ចុប្បន្នភាពស្ថានភាព",
inProgress: "កំពុងដំណើរការ",
enterRootCause: 'បញ្ចូលហេតុផលដើម',
};
@@ -9,4 +9,13 @@ export const servicesTranslations: ServicesTranslations = {
uptime: "ពេលវេលាដំណើរការ",
lastChecked: "ពិនិត្យចុងក្រោយ",
noServices: "មិនមានសេវាកម្មដែលត្រូវនឹងលក្ខណៈវិនិច្ឆ័យរបស់អ្នក។",
currentlyMonitoring: "កំពុងតាមដានពេលនេះ",
retry: "សាកល្បងម្ដងទៀត",
overview: "ទិដ្ឋភាពទូទៅ",
newService: "សេវាកម្មថ្មី",
rowsPerPage: "ចំនួនជួរដេកក្នុងមួយទំព័រ",
search: "ស្វែងរក",
allTypes: "គ្រប់ប្រភេទ",
createNewService: "បង្កើតសេវាកម្មថ្មី",
createNewServiceDesc: "បញ្ចូលព័ត៌មានលម្អិតដើម្បីបង្កើតសេវាកម្មថ្មីដែលត្រូវតាមដាន។",
};
+2 -1
View File
@@ -112,5 +112,6 @@ export const sslTranslations: SSLTranslations = {
created: "បានបង្កើត",
lastUpdated: "បានធ្វើបច្ចុប្បន្នភាពចុងក្រោយ",
lastNotification: "ការជូនដំណឹងចុងក្រោយ",
collectionId: "លេខសម្គាល់ប្រមូលផ្តុំ"
collectionId: "លេខសម្គាល់ប្រមូលផ្តុំ",
noCertificatesFound: "រកមិនឃើញវិញ្ញាបនប័ត្រ",
};
@@ -13,4 +13,5 @@ export interface AboutTranslations {
quickActions: string;
quickActionsDescription: string;
quickTips: string;
releasedOn: string;
}
@@ -50,4 +50,5 @@ export interface IncidentTranslations {
configuration: string;
failedToUpdateStatus: string;
inProgress: string;
enterRootCause: string;
}
@@ -7,4 +7,13 @@ export interface ServicesTranslations {
uptime: string;
lastChecked: string;
noServices: string;
currentlyMonitoring: string;
retry: string;
overview: string;
newService: string;
rowsPerPage: string;
search: string;
allTypes: string;
createNewService: string;
createNewServiceDesc: string;
}
@@ -111,4 +111,5 @@ export interface SSLTranslations {
lastUpdated: string;
lastNotification: string;
collectionId: string;
noCertificatesFound: string;
}
+2 -1
View File
@@ -2,7 +2,7 @@
import { AboutTranslations } from '../types/about';
export const aboutTranslations: AboutTranslations = {
aboutCheckcle: "关于 Checkcle",
aboutCheckCle: "关于 Checkcle",
systemDescription: "Checkcle 是一个开源监控平台,可提供有关服务器和服务健康状况的实时洞察、事件管理以及透明化运营。以 MIT 许可证发布。",
systemVersion: "系统版本",
license: "许可证",
@@ -15,4 +15,5 @@ export const aboutTranslations: AboutTranslations = {
quickActions: "快速操作",
quickActionsDescription: "快速访问常用的监控操作和功能。选择下面的操作开始。",
quickTips: "快速提示",
releasedOn: "发布于",
};
+3 -2
View File
@@ -5,9 +5,10 @@ export const commonTranslations: CommonTranslations = {
welcome: "欢迎",
logout: "注销",
language: "语言",
english: "English",
khmer: "Khmer",
english: "Englisch",
khmer: "ភាសាខ្មែរ",
german: "Deutsch",
japanese: "日本語",
simplifiedChinese: "简体中文",
goodMorning: "早上好",
goodAfternoon: "下午好",
@@ -52,4 +52,5 @@ export const incidentTranslations: IncidentTranslations = {
configuration: '配置',
failedToUpdateStatus: '更新状态失败',
inProgress: '进行中',
enterRootCause: '输入故障根源',
};
+1 -1
View File
@@ -2,7 +2,7 @@
import { MenuTranslations } from '../types/menu';
export const menuTranslations: MenuTranslations = {
uptimeMonitoring: "Uptime 监控",
uptimeMonitoring: "在线监控",
instanceMonitoring: "实例监控",
sslDomain: "SSL & 域名",
scheduleIncident: "计划与事件",
+10 -1
View File
@@ -6,7 +6,16 @@ export const servicesTranslations: ServicesTranslations = {
serviceType: "服务类型",
serviceStatus: "服务状态",
responseTime: "响应时间",
uptime: "Uptime",
uptime: "在线",
lastChecked: "最后检查时间",
noServices: "没有符合您筛选条件的服务。",
currentlyMonitoring: "当前监控",
retry: "重试",
overview: "概览",
newService: "新增服务",
rowsPerPage: "每页行数",
search: "搜索",
allTypes: "所有类型",
createNewService: "添加新服务",
createNewServiceDesc: "填写详细信息以创建要监控的新服务。",
};
+2 -1
View File
@@ -112,5 +112,6 @@ export const sslTranslations: SSLTranslations = {
created: "创建时间",
lastUpdated: "最后更新时间",
lastNotification: "最后通知时间",
collectionId: "集合 ID"
collectionId: "集合 ID",
noCertificatesFound: "未找到证书",
};