Add Chinese (Simplified and Traditional) localization files and implement i18n tests

- Created zh-CN.json and zh-TW.json for Simplified and Traditional Chinese translations respectively.
- Added comprehensive test suite in test_i18n.py to validate JSON structure, server-side i18n functionality, and translation completeness across multiple languages.
This commit is contained in:
Will Miao
2025-08-30 21:41:48 +08:00
parent f6709a55c3
commit 52acbd954a
36 changed files with 4662 additions and 3819 deletions

View File

@@ -2,26 +2,26 @@
<div id="duplicatesBanner" class="duplicates-banner" style="display: none;">
<div class="banner-content">
<i class="fas fa-exclamation-triangle"></i>
<span id="duplicatesCount">Found 0 duplicate groups</span>
<i class="fas fa-question-circle help-icon" id="duplicatesHelp" aria-label="Help information"></i>
<span id="duplicatesCount">{{ t('duplicates.found', count=0) }}</span>
<i class="fas fa-question-circle help-icon" id="duplicatesHelp" aria-label="{{ t('common.actions.help') }}"></i>
<div class="banner-actions">
<div class="setting-contro" id="badgeToggleControl">
<span>Show Duplicates Notification:</span>
<span>{{ t('duplicates.showNotification') }}:</span>
<label class="toggle-switch">
<input type="checkbox" id="badgeToggleInput">
<span class="toggle-slider"></span>
</label>
</div>
<button class="btn-delete-selected disabled" onclick="modelDuplicatesManager.deleteSelectedDuplicates()">
Delete Selected (<span id="duplicatesSelectedCount">0</span>)
{{ t('duplicates.deleteSelected') }} (<span id="duplicatesSelectedCount">0</span>)
</button>
<button class="btn-exit-mode" onclick="modelDuplicatesManager.exitDuplicateMode()">
<i class="fas fa-times"></i> Exit Mode
<i class="fas fa-times"></i> {{ t('duplicates.exitMode') }}
</button>
</div>
</div>
<div class="help-tooltip" id="duplicatesHelpTooltip">
<p>Identical hashes mean identical model files, even if they have different names or previews.</p>
<p>Keep only one version (preferably with better metadata/previews) and safely delete the others.</p>
<p>{{ t('duplicates.help.identicalHashes') }}</p>
<p>{{ t('duplicates.help.keepOne') }}</p>
</div>
</div>