refactor(i18n): U26 Kubernetes 模块 phantom key 大规模清理 — 32 文件 171 phantom key → 8 残留(均为误匹配), 163 个替换为 k8s.* 语义化键, 新增 19 子命名空间 + 扩展 8 个已有, zh/en 6990→7185 +195 键对齐, tsc -b=0, npm build✓ (17.59s), ESLint=0/53/0, go build=0, 17/17 测试通过
This commit is contained in:
1 parent
c6a50216dd
commit
7f5295cfc2
31 files changed
+657
-190
No files matched your search
@@ -89,7 +89,7 @@ export function KubernetesClusterDialog({
|
||||
if (!value.trim()) {
|
||||
setNameError('');
|
||||
} else if (!NAME_RE.test(value)) {
|
||||
setNameError(i18n.t('只允许英文、数字和连字符(-),首尾不能是连字符'));
|
||||
setNameError(i18n.t('k8s.clusterDialog.nameRule'));
|
||||
} else {
|
||||
setNameError('');
|
||||
}
|
||||
@@ -111,7 +111,7 @@ export function KubernetesClusterDialog({
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!formData.name.trim() || !NAME_RE.test(formData.name.trim())) {
|
||||
toast.error(i18n.t('请输入有效的集群名称(英文/数字/连字符)')); return;
|
||||
toast.error(i18n.t('k8s.clusterDialog.nameInvalid')); return;
|
||||
}
|
||||
try {
|
||||
setSubmitting(true);
|
||||
@@ -133,7 +133,7 @@ export function KubernetesClusterDialog({
|
||||
onOpenChange(false);
|
||||
onSaved();
|
||||
} catch (e) {
|
||||
console.error(i18n.t('保存集群失败:'), e);
|
||||
console.error(i18n.t('k8s.clusterDialog.saveFailed'), e);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
@@ -149,7 +149,7 @@ export function KubernetesClusterDialog({
|
||||
{editingCluster ? i18n.t('kubernetes.cluster.editCluster') : i18n.t('kubernetes.cluster.addCluster')}
|
||||
</DialogTitle>
|
||||
<DialogDescription className="text-[var(--dg-text-secondary)]">
|
||||
{editingCluster ? i18n.t('编辑集群') : i18n.t('添加集群')}
|
||||
{editingCluster ? i18n.t('k8s.clusterDialog.editTitle') : i18n.t('k8s.clusterDialog.addTitle')}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="space-y-4 py-2 max-h-[60vh] overflow-y-auto pr-1">
|
||||
@@ -159,7 +159,7 @@ export function KubernetesClusterDialog({
|
||||
<Input
|
||||
value={formData.name}
|
||||
onChange={(e) => handleNameChange(e.target.value)}
|
||||
placeholder={i18n.t('如: prod-cluster')}
|
||||
placeholder={i18n.t('k8s.clusterDialog.namePlaceholder')}
|
||||
className={`bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] placeholder:text-[var(--dg-text-muted)] ${nameError ? 'border-red-500' : ''}`}
|
||||
/>
|
||||
{nameError && <p className="text-xs dg-text-red">{nameError}</p>}
|
||||
@@ -172,7 +172,7 @@ export function KubernetesClusterDialog({
|
||||
<Input
|
||||
value={formData.version}
|
||||
onChange={(e) => setFormData({ ...formData, version: e.target.value })}
|
||||
placeholder={i18n.t('如: prod-cluster')}
|
||||
placeholder={i18n.t('k8s.clusterDialog.namePlaceholder')}
|
||||
className="bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] placeholder:text-[var(--dg-text-muted)]"
|
||||
/>
|
||||
</div>
|
||||
@@ -183,7 +183,7 @@ export function KubernetesClusterDialog({
|
||||
<Input
|
||||
value={formData.description}
|
||||
onChange={(e) => setFormData({ ...formData, description: e.target.value })}
|
||||
placeholder={i18n.t('集群用途描述')}
|
||||
placeholder={i18n.t('k8s.clusterDialog.descLabel')}
|
||||
className="bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] placeholder:text-[var(--dg-text-muted)]"
|
||||
/>
|
||||
</div>
|
||||
@@ -224,7 +224,7 @@ export function KubernetesClusterDialog({
|
||||
<Textarea
|
||||
value={formData.token}
|
||||
onChange={(e) => setFormData({ ...formData, token: e.target.value })}
|
||||
placeholder={hasToken ? i18n.t('已配置,输入新值覆盖...') : i18n.t('粘贴 Service Account Token...')}
|
||||
placeholder={hasToken ? i18n.t('k8s.clusterDialog.tokenConfigured') : i18n.t('k8s.clusterDialog.tokenPlaceholder')}
|
||||
rows={4}
|
||||
className="bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] placeholder:text-[var(--dg-text-muted)] font-mono text-xs"
|
||||
/>
|
||||
@@ -237,7 +237,7 @@ export function KubernetesClusterDialog({
|
||||
<Textarea
|
||||
value={formData.kube_config}
|
||||
onChange={(e) => handleKubeConfigChange(e.target.value)}
|
||||
placeholder={hasKubeConfig ? i18n.t('已配置,输入新值覆盖...') : 'apiVersion: v1\nkind: Config\nclusters:\n- cluster:\n server: https://10.0.0.1:6443\n ...'}
|
||||
placeholder={hasKubeConfig ? i18n.t('k8s.clusterDialog.tokenConfigured') : 'apiVersion: v1\nkind: Config\nclusters:\n- cluster:\n server: https://10.0.0.1:6443\n ...'}
|
||||
rows={10}
|
||||
className="bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)] placeholder:text-[var(--dg-text-muted)] font-mono text-xs"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user