diff --git a/src/i18n/languages.ts b/src/i18n/languages.ts index 85ffdee..9026732 100644 --- a/src/i18n/languages.ts +++ b/src/i18n/languages.ts @@ -282,6 +282,7 @@ export const ui = { 'activities.xcamp.feature3Desc': '人工智能、生物科技、航天等多领域探索', 'activities.xcamp.feature4': '成果展示', 'activities.xcamp.feature4Desc': '论文发表、专利申请、学术会议报告机会', + 'activities.xcamp.training': '科研训练', 'activities.owl.tag': 'Night at OWL', 'activities.owl.title': '猫头鹰奇妙夜', 'activities.owl.subtitle': 'Night at OWL', @@ -315,9 +316,11 @@ export const ui = { 'spaces.design.techFutureDesc': '具有科技感和未来感的设计,激发创新想法的诞生', 'spaces.design.flexible': '灵活流动空间', 'spaces.design.flexibleDesc': '灵活、流动和多样化的空间代替隔离、固定的传统布局', + 'spaces.design.special': '特别', 'spaces.design.creativeZone': '创意自由区', 'spaces.design.creativeZoneDesc': '留有学生自由涂鸦和可破坏的"混乱"空间。我们相信,真正的创造力需要自由的表达空间,', 'spaces.design.creativeZoneHighlight': '无拘无束的探索往往带来最意想不到的创新', + 'spaces.owlSpace': '猫头鹰空间', 'spaces.locations.title': '我们的空间', 'spaces.locations.subtitle': '分布在深圳和北京的三处核心空间,为学生提供多元化的学习和创新环境', 'spaces.pingshan.name': '深圳坪山基地', @@ -909,6 +912,7 @@ export const ui = { 'activities.xcamp.feature3Desc': 'Exploration across AI, biotechnology, aerospace, and more', 'activities.xcamp.feature4': 'Achievement Showcase', 'activities.xcamp.feature4Desc': 'Opportunities for paper publication, patent applications, and academic conference presentations', + 'activities.xcamp.training': 'Research Training', 'activities.owl.tag': 'Night at OWL', 'activities.owl.title': 'Night at OWL', 'activities.owl.subtitle': 'Night at OWL', @@ -942,9 +946,11 @@ export const ui = { 'spaces.design.techFutureDesc': 'Design with technological and futuristic elements to inspire innovative ideas', 'spaces.design.flexible': 'Flexible & Fluid Spaces', 'spaces.design.flexibleDesc': 'Flexible, fluid, and diverse spaces replace isolated, fixed traditional layouts', + 'spaces.design.special': 'Special', 'spaces.design.creativeZone': 'Creative Free Zone', 'spaces.design.creativeZoneDesc': 'Spaces for free graffiti and "chaos" that students can freely modify. We believe true creativity needs space for free expression,', 'spaces.design.creativeZoneHighlight': 'Unfettered exploration often leads to the most unexpected innovations', + 'spaces.owlSpace': 'OWL Space', 'spaces.locations.title': 'Our Spaces', 'spaces.locations.subtitle': 'Three core spaces across Shenzhen and Beijing, providing students with diverse learning and innovation environments', 'spaces.pingshan.name': 'Shenzhen Pingshan Base', diff --git a/src/pages/activities.astro b/src/pages/activities.astro index 3e70ac6..ad46171 100644 --- a/src/pages/activities.astro +++ b/src/pages/activities.astro @@ -93,7 +93,7 @@ const meta = { X
CAMP
-
RESEARCH TRAINING
+
RESEARCH TRAINING
@@ -114,9 +114,9 @@ const meta = {
🦉
-
Night at OWL
-
猫头鹰奇妙夜
-
+
Night at OWL
+
猫头鹰奇妙夜
+
"让思维有地方闲逛,让想象力在无意中开花"
diff --git a/src/pages/contact.astro b/src/pages/contact.astro index 205f173..91b4dc5 100644 --- a/src/pages/contact.astro +++ b/src/pages/contact.astro @@ -32,10 +32,10 @@ const meta = {

- 联系我们 + 联系我们

diff --git a/src/pages/spaces.astro b/src/pages/spaces.astro index b9c7d08..c75a3cb 100644 --- a/src/pages/spaces.astro +++ b/src/pages/spaces.astro @@ -136,7 +136,7 @@ const spaces = [ ~
-
+
Special

创意自由区

@@ -198,7 +198,7 @@ const spaces = [
{space.icon}
-
+
OWL Space
diff --git a/src/scripts/i18n-client.ts b/src/scripts/i18n-client.ts index 7d8eb1b..c14f183 100644 --- a/src/scripts/i18n-client.ts +++ b/src/scripts/i18n-client.ts @@ -20,6 +20,36 @@ export function applyTranslations(lang: LangKey) { } }); + // Handle data-i18n-list for list items (comma-separated translations) + const listElements = document.querySelectorAll('[data-i18n-list]'); + listElements.forEach((listElement) => { + const key = listElement.getAttribute('data-i18n-list') as TranslationKey; + if (key && ui[lang] && ui[lang][key]) { + const items = ui[lang][key].split(', '); + const liElements = listElement.querySelectorAll('li'); + liElements.forEach((li, index) => { + if (items[index]) { + // Find the text node (skip the span with bullet) + const textNodes = Array.from(li.childNodes).filter(node => + node.nodeType === Node.TEXT_NODE || + (node.nodeType === Node.ELEMENT_NODE && !(node as Element).classList.contains('w-1.5')) + ); + // Update the last text content (after the bullet span) + if (textNodes.length > 0) { + const lastNode = textNodes[textNodes.length - 1]; + if (lastNode) { + if (lastNode.nodeType === Node.TEXT_NODE) { + lastNode.textContent = items[index]; + } else { + (lastNode as Element).textContent = items[index]; + } + } + } + } + }); + } + }); + // Update language display in toggle button const langToggle = document.querySelector('#language-toggle span'); if (langToggle) {