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:
YiZixuan
2025-09-08 20:54:56 +08:00
parent 0a70ed2143
commit b675fddc92
4 changed files with 13 additions and 3 deletions
@@ -411,9 +411,9 @@ export const AboutSystem: React.FC = () => {
? 'text-green-700 dark:text-green-300'
: 'text-red-700 dark:text-red-300'
}`}>
{importResult.created > 0 && `${importResult.created} collections created`}
{importResult.updated > 0 && (importResult.created > 0 ? ', ' : '') + `${importResult.updated} collections updated`}
{importResult.skipped > 0 && ((importResult.created > 0 || importResult.updated > 0) ? ', ' : '') + `${importResult.skipped} collections skipped`}
{importResult.created > 0 && t('collectionsCreatedCount').replace('{count}', String(importResult.created))}
{importResult.updated > 0 && (importResult.created > 0 ? ', ' : '') + t('collectionsUpdatedCount').replace('{count}', String(importResult.updated))}
{importResult.skipped > 0 && ((importResult.created > 0 || importResult.updated > 0) ? ', ' : '') + t('collectionsSkippedCount').replace('{count}', String(importResult.skipped))}
</div>
</div>
)}
+4
View File
@@ -23,8 +23,12 @@ export const aboutTranslations: AboutTranslations = {
clickToUpdateSchema: "Click to update Schema",
importSuccessful: "Import Successful",
importFailed: "Import Failed",
instructions: "Instructions",
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",
collectionsUpdatedCount: "{count} collections updated",
collectionsCreatedCount: "{count} collections created",
collectionsSkippedCount: "{count} collections created",
};
@@ -26,4 +26,7 @@ export interface AboutTranslations {
instructionsMergeFields: string;
instructionsCollections: string;
instructionsImportAuth: string;
collectionsUpdatedCount: string;
collectionsCreatedCount: string;
collectionsSkippedCount: string;
}
@@ -28,4 +28,7 @@ export const aboutTranslations: AboutTranslations = {
instructionsMergeFields: "安全地向现有集合添加新字段,保留所有数据",
instructionsCollections: "系统集合(以_开头的)和用户集合将被自动跳过",
instructionsImportAuth: "只有经过身份验证的管理员才能执行架构导入",
collectionsUpdatedCount: "已更新 {count} 个集合",
collectionsCreatedCount: "已创建 {count} 个集合",
collectionsSkippedCount: "已跳过 {count} 个集合",
};