From b543446a44dbc0c7ab586cbf4539f5416dc35f7e Mon Sep 17 00:00:00 2001 From: 1330Petrel Date: Mon, 17 Feb 2025 18:38:05 +0800 Subject: [PATCH] add some translations --- i18n/en/code.json | 23 ++++++++++++++++ i18n/en/docusaurus-theme-classic/navbar.json | 3 +++ src/components/HomepageFeatures/index.tsx | 28 +++++++++++--------- 3 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 i18n/en/code.json diff --git a/i18n/en/code.json b/i18n/en/code.json new file mode 100644 index 0000000..60c1c3f --- /dev/null +++ b/i18n/en/code.json @@ -0,0 +1,23 @@ +{ + "homepage.topBanner": { + "message": "Call for Papers, commence!" + }, + "homepage.features.software.title": { + "message": "Software Department" + }, + "homepage.features.software.description": { + "message": "The software department is responsible for the construction and testing of the artificial intelligence challenge, the student festival game platform, the electronic design competition platform, website maintenance, etc. We pay attention to code quality and team collaboration, and welcome you to join!" + }, + "homepage.features.hardware.title": { + "message": "Hardware Department" + }, + "homepage.features.hardware.description": { + "message": "The hardware department focuses on hardware innovation and development, and is responsible for the development of electronic design competitions, robot dogs and other competitions. Looking forward to your joining!" + }, + "homepage.features.innovation.title": { + "message": "Learning and Innovation Department" + }, + "homepage.features.innovation.description": { + "message": "The Department of Learning and Innovation is responsible for docking with various scientific research and training projects of the school, such as the Spark Project, the Challenge Cup, and the enterprise laboratory, to help students complete their life development planning. Welcome you to join!" + } +} \ No newline at end of file diff --git a/i18n/en/docusaurus-theme-classic/navbar.json b/i18n/en/docusaurus-theme-classic/navbar.json index f62f918..5abefbd 100644 --- a/i18n/en/docusaurus-theme-classic/navbar.json +++ b/i18n/en/docusaurus-theme-classic/navbar.json @@ -2,6 +2,9 @@ "title": { "message": "ASTA" }, + "logo.alt": { + "message": "ASTA" + }, "item.label.文档": { "message": "Docs" }, diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 478a38e..2dc9cd7 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -1,9 +1,7 @@ import clsx from 'clsx'; +import Translate, { translate } from '@docusaurus/Translate'; import Heading from '@theme/Heading'; import styles from './styles.module.css'; -import SoftwareSvg from '@site/static/img/software.svg'; -import HardwareSvg from '@site/static/img/hardware.svg'; -import InnovationSvg from '@site/static/img/innovation.svg'; import React, { JSX } from 'react'; @@ -15,29 +13,35 @@ type FeatureItem = { const FeatureList: FeatureItem[] = [ { - title: '软件部', - Svg: SoftwareSvg, + title: translate({ "message": '软件部', "id": "homepage.features.software.title" }), + Svg: 'img/software.svg', description: (

- 软件部负责人工智能挑战赛,学生节游戏平台,电子设计大赛平台的搭建测试,网站维护等工作,我们注重代码质量和团队协作,欢迎你的加入! + + 软件部负责人工智能挑战赛,学生节游戏平台,电子设计大赛平台的搭建测试,网站维护等工作,我们注重代码质量和团队协作,欢迎你的加入! +

), }, { - title: '硬件部', - Svg: HardwareSvg, + title: translate({ "message": '硬件部', "id": "homepage.features.hardware.title" }), + Svg: 'img/hardware.svg', description: (

- 硬件部专注于硬件创新与开发,负责电子设计大赛,机器狗等比赛的开发,期待你的加入! + + 硬件部专注于硬件创新与开发,负责电子设计大赛,机器狗等比赛的开发,期待你的加入! +

), }, { - title: '学创部', - Svg: InnovationSvg, + title: translate({ "message": '学创部', "id": "homepage.features.innovation.title" }), + Svg: 'img/innovation.svg', description: (

- 学创部负责对接学校的各类科研培养项目,如星火计划、挑战杯,与企业实验室对接,帮助同学们完成人生发展规划,欢迎你的加入! + + 学创部负责对接学校的各类科研培养项目,如星火计划、挑战杯,与企业实验室对接,帮助同学们完成人生发展规划,欢迎你的加入! +

), },