fix(i18n): translate hardcoded UI labels in Step1 ontology panel

Replace hardcoded English strings (GENERATED ENTITY TYPES, ATTRIBUTES,
EXAMPLES, etc.) and the Uploading message with i18n keys.
Add corresponding translations to all 4 locale files (ca/en/zh/es).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-04-24 23:45:57 +00:00
parent 7d172b9eec
commit a6437df335
6 changed files with 39 additions and 11 deletions

View File

@ -31,7 +31,7 @@
<div v-if="selectedOntologyItem" class="ontology-detail-overlay">
<div class="detail-header">
<div class="detail-title-group">
<span class="detail-type-badge">{{ selectedOntologyItem.itemType === 'entity' ? 'ENTITY' : 'RELATION' }}</span>
<span class="detail-type-badge">{{ selectedOntologyItem.itemType === 'entity' ? $t('step1.labelEntity') : $t('step1.labelRelation') }}</span>
<span class="detail-name">{{ selectedOntologyItem.name }}</span>
</div>
<button class="close-btn" @click="selectedOntologyItem = null">×</button>
@ -41,7 +41,7 @@
<!-- Attributes -->
<div class="detail-section" v-if="selectedOntologyItem.attributes?.length">
<span class="section-label">ATTRIBUTES</span>
<span class="section-label">{{ $t('step1.labelAttributes') }}</span>
<div class="attr-list">
<div v-for="attr in selectedOntologyItem.attributes" :key="attr.name" class="attr-item">
<span class="attr-name">{{ attr.name }}</span>
@ -53,7 +53,7 @@
<!-- Examples (Entity) -->
<div class="detail-section" v-if="selectedOntologyItem.examples?.length">
<span class="section-label">EXAMPLES</span>
<span class="section-label">{{ $t('step1.labelExamples') }}</span>
<div class="example-list">
<span v-for="ex in selectedOntologyItem.examples" :key="ex" class="example-tag">{{ ex }}</span>
</div>
@ -61,7 +61,7 @@
<!-- Source/Target (Relation) -->
<div class="detail-section" v-if="selectedOntologyItem.source_targets?.length">
<span class="section-label">CONNECTIONS</span>
<span class="section-label">{{ $t('step1.labelConnections') }}</span>
<div class="conn-list">
<div v-for="(conn, idx) in selectedOntologyItem.source_targets" :key="idx" class="conn-item">
<span class="conn-node">{{ conn.source }}</span>
@ -75,7 +75,7 @@
<!-- Generated Entity Tags -->
<div v-if="projectData?.ontology?.entity_types" class="tags-container" :class="{ 'dimmed': selectedOntologyItem }">
<span class="tag-label">GENERATED ENTITY TYPES</span>
<span class="tag-label">{{ $t('step1.labelEntityTypes') }}</span>
<div class="tags-list">
<span
v-for="entity in projectData.ontology.entity_types"
@ -90,7 +90,7 @@
<!-- Generated Relation Tags -->
<div v-if="projectData?.ontology?.edge_types" class="tags-container" :class="{ 'dimmed': selectedOntologyItem }">
<span class="tag-label">GENERATED RELATION TYPES</span>
<span class="tag-label">{{ $t('step1.labelRelationTypes') }}</span>
<div class="tags-list">
<span
v-for="rel in projectData.ontology.edge_types"

View File

@ -202,7 +202,7 @@ const handleNewProject = async () => {
try {
loading.value = true
currentPhase.value = 0
ontologyProgress.value = { message: 'Uploading and analyzing docs...' }
ontologyProgress.value = { message: t('step1.analyzingDocs') }
addLog('Starting ontology generation: Uploading files...')
const formData = new FormData()

View File

@ -101,7 +101,14 @@
"creating": "Creant...",
"enterEnvSetup": "Entra a la configuració de l'entorn",
"createSimulationFailed": "Error en crear la simulació: {error}",
"createSimulationException": "Excepció en crear la simulació: {error}"
"createSimulationException": "Excepció en crear la simulació: {error}",
"labelEntityTypes": "TIPUS D'ENTITAT GENERATS",
"labelRelationTypes": "TIPUS DE RELACIÓ GENERATS",
"labelEntity": "ENTITAT",
"labelRelation": "RELACIÓ",
"labelAttributes": "ATRIBUTS",
"labelExamples": "EXEMPLES",
"labelConnections": "CONNEXIONS"
},
"step2": {
"simInstanceInit": "Inicialització de la instància de simulació",

View File

@ -101,7 +101,14 @@
"creating": "Creating...",
"enterEnvSetup": "Enter Environment Setup",
"createSimulationFailed": "Failed to create simulation: {error}",
"createSimulationException": "Simulation creation error: {error}"
"createSimulationException": "Simulation creation error: {error}",
"labelEntityTypes": "GENERATED ENTITY TYPES",
"labelRelationTypes": "GENERATED RELATION TYPES",
"labelEntity": "ENTITY",
"labelRelation": "RELATION",
"labelAttributes": "ATTRIBUTES",
"labelExamples": "EXAMPLES",
"labelConnections": "CONNECTIONS"
},
"step2": {
"simInstanceInit": "Simulation Instance Initialization",

View File

@ -101,7 +101,14 @@
"creating": "Creando...",
"enterEnvSetup": "Entrar a configuración del entorno",
"createSimulationFailed": "Error al crear simulación: {error}",
"createSimulationException": "Excepción al crear simulación: {error}"
"createSimulationException": "Excepción al crear simulación: {error}",
"labelEntityTypes": "TIPOS DE ENTIDAD GENERADOS",
"labelRelationTypes": "TIPOS DE RELACIÓN GENERADOS",
"labelEntity": "ENTIDAD",
"labelRelation": "RELACIÓN",
"labelAttributes": "ATRIBUTOS",
"labelExamples": "EJEMPLOS",
"labelConnections": "CONEXIONES"
},
"step2": {
"simInstanceInit": "Inicialización de instancia de simulación",

View File

@ -101,7 +101,14 @@
"creating": "创建中...",
"enterEnvSetup": "进入环境搭建",
"createSimulationFailed": "创建模拟失败: {error}",
"createSimulationException": "创建模拟异常: {error}"
"createSimulationException": "创建模拟异常: {error}",
"labelEntityTypes": "生成的实体类型",
"labelRelationTypes": "生成的关系类型",
"labelEntity": "实体",
"labelRelation": "关系",
"labelAttributes": "属性",
"labelExamples": "示例",
"labelConnections": "连接"
},
"step2": {
"simInstanceInit": "模拟实例初始化",