refactory(i18n): Added architecture import function translation for the "About" page
- Added translation items related to schema import in English, Chinese, and type definition files - Replaced hard-coded text with new translation items in the AboutSystem component
This commit is contained in:
@@ -355,9 +355,9 @@ export const AboutSystem: React.FC = () => {
|
||||
<CardHeader className="bg-muted/50 pb-4">
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Database className={`h-5 w-5 ${theme === 'dark' ? 'text-blue-400' : 'text-blue-600'}`} />
|
||||
<span>Update Schema</span>
|
||||
<span>{t('updateSchema')}</span>
|
||||
</CardTitle>
|
||||
<CardDescription className="font-medium text-base">Automatic import collections schema</CardDescription>
|
||||
<CardDescription className="font-medium text-base">{t('updateSchemaDesc')}</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4 pt-6">
|
||||
<div className="space-y-3">
|
||||
@@ -368,7 +368,7 @@ export const AboutSystem: React.FC = () => {
|
||||
onCheckedChange={(checked) => setMergeFields(checked === true)}
|
||||
/>
|
||||
<Label htmlFor="merge-fields" className="text-sm font-medium">
|
||||
Merge fields with existing collections (safe - preserves data)
|
||||
{t('mergeFieldsLabel')}
|
||||
</Label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -382,7 +382,7 @@ export const AboutSystem: React.FC = () => {
|
||||
}`}
|
||||
>
|
||||
<Database className={`h-4 w-4 ${isImporting ? 'animate-spin' : ''}`} />
|
||||
{isImporting ? 'Importing...' : 'Click to update Schema'}
|
||||
{isImporting ? t('importing') : t('clickToUpdateSchema')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -403,7 +403,7 @@ export const AboutSystem: React.FC = () => {
|
||||
? 'text-green-800 dark:text-green-200'
|
||||
: 'text-red-800 dark:text-red-200'
|
||||
}`}>
|
||||
{importResult.success ? 'Import Successful' : 'Import Failed'}
|
||||
{importResult.success ? t('importSuccessful') : t('importFailed')}
|
||||
</span>
|
||||
</div>
|
||||
<div className={`mt-2 text-sm ${
|
||||
@@ -420,12 +420,12 @@ export const AboutSystem: React.FC = () => {
|
||||
|
||||
<div className="text-sm text-muted-foreground">
|
||||
<p className="mb-2">
|
||||
<strong>Instructions:</strong>
|
||||
<strong>{t('instructions')}:</strong>
|
||||
</p>
|
||||
<ul className="list-disc list-inside space-y-1 ml-2">
|
||||
<li><strong>Merge fields:</strong> Safely add new fields to existing collections, preserves all data</li>
|
||||
<li>System collections (starting with _) and users collection will be skipped automatically</li>
|
||||
<li>Only authenticated admins can perform schema imports</li>
|
||||
<li><strong>{t('mergeFields')}:</strong> {t('instructionsMergeFields')}</li>
|
||||
<li>{t('instructionsCollections')}</li>
|
||||
<li>{t('instructionsImportAuth')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -16,4 +16,15 @@ export const aboutTranslations: AboutTranslations = {
|
||||
quickActionsDescription: "Access common monitoring operations and features quickly. Select an action below to get started.",
|
||||
quickTips: "Quick Tips",
|
||||
releasedOn: "Released On",
|
||||
updateSchema: "Update Schema",
|
||||
updateSchemaDesc: "Automatic import collections schema",
|
||||
mergeFieldsLabel: "Merge fields with existing collections (safe - preserves data)",
|
||||
importing: "Importing...",
|
||||
clickToUpdateSchema: "Click to update Schema",
|
||||
importSuccessful: "Import Successful",
|
||||
importFailed: "Import Failed",
|
||||
mergeFields: "Merge fields",
|
||||
instructionsMergeFields: "Safely add new fields to existing collections, preserves all data",
|
||||
instructionsCollections: "System collections (starting with _) and users collection will be skipped automatically",
|
||||
instructionsImportAuth: "Only authenticated admins can perform schema imports",
|
||||
};
|
||||
|
||||
@@ -14,4 +14,16 @@ export interface AboutTranslations {
|
||||
quickActionsDescription: string;
|
||||
quickTips: string;
|
||||
releasedOn: string;
|
||||
updateSchema: string;
|
||||
updateSchemaDesc: string;
|
||||
mergeFieldsLabel: string;
|
||||
importing: string;
|
||||
clickToUpdateSchema: string;
|
||||
importSuccessful: string;
|
||||
importFailed: string;
|
||||
instructions: string;
|
||||
mergeFields: string;
|
||||
instructionsMergeFields: string;
|
||||
instructionsCollections: string;
|
||||
instructionsImportAuth: string;
|
||||
}
|
||||
|
||||
@@ -16,4 +16,16 @@ export const aboutTranslations: AboutTranslations = {
|
||||
quickActionsDescription: "快速访问常用的监控操作和功能。选择下面的操作开始。",
|
||||
quickTips: "快速提示",
|
||||
releasedOn: "发布于",
|
||||
updateSchema: "更新架构",
|
||||
updateSchemaDesc: "自动导入集合架构",
|
||||
mergeFieldsLabel: "合并字段到现有集合(安全 - 保留数据)",
|
||||
importing: "导入中...",
|
||||
clickToUpdateSchema: "点击更新架构",
|
||||
importSuccessful: "导入成功",
|
||||
importFailed: "导入失败",
|
||||
instructions: "说明",
|
||||
mergeFields: "合并字段",
|
||||
instructionsMergeFields: "安全地向现有集合添加新字段,保留所有数据",
|
||||
instructionsCollections: "系统集合(以_开头的)和用户集合将被自动跳过",
|
||||
instructionsImportAuth: "只有经过身份验证的管理员才能执行架构导入",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user