This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 98b2fbec130 fix: event not suport chinese (#1534)
98b2fbec130 is described below

commit 98b2fbec130cda12955e3b92eb8df0a057d272bf
Author: litesun <[email protected]>
AuthorDate: Tue Mar 21 14:46:21 2023 +0800

    fix: event not suport chinese (#1534)
---
 website/docusaurus.config.js                       |   5 +-
 website/i18n/zh/code.json                          |   3 +
 .../src/components/sections/HomeEventsSection.tsx  |  12 +-
 website/static/data/events.zh.json                 | 169 +++++++++++++++++++++
 4 files changed, 184 insertions(+), 5 deletions(-)

diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 094cb721b9a..8a49ed8b012 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -14,7 +14,10 @@ module.exports = {
     tagline2:
       'Apache APISIX provides rich traffic management features such as load 
balancing, dynamic upstream, canary release, circuit breaking, authentication, 
observability, and more.',
     showcases: require('./static/data/showcases.json'),
-    events: require('./static/data/events.json'),
+    events: {
+      en: require('./static/data/events.json'),
+      zh: require('./static/data/events.zh.json'),
+    },
     repoUrl: 'https://github.com/apache/apisix',
     docsUrl: '',
     docs: require('../config/docs.js'),
diff --git a/website/i18n/zh/code.json b/website/i18n/zh/code.json
index 8f36fa2380c..6062501be3f 100644
--- a/website/i18n/zh/code.json
+++ b/website/i18n/zh/code.json
@@ -316,6 +316,9 @@
     "message": "请订阅我们的邮件列表",
     "description": "newsletter."
   },
+  "homeEventsSection.component.readMore": {
+    "message": "阅读更多"
+  },
   "homeEventsSection.component.link.Subscribe": {
     "message": "立即订阅",
     "description": "Subscribe"
diff --git a/website/src/components/sections/HomeEventsSection.tsx 
b/website/src/components/sections/HomeEventsSection.tsx
index 086b508b229..88b975414b5 100644
--- a/website/src/components/sections/HomeEventsSection.tsx
+++ b/website/src/components/sections/HomeEventsSection.tsx
@@ -12,8 +12,11 @@ interface EventInfo {
 }
 
 const Events: FC = () => {
-  const { siteConfig } = useDocusaurusContext();
-  const events = (siteConfig.customFields.events as EventInfo[]).slice(0, 
4).map((event) => {
+  const { siteConfig, i18n: { currentLocale } } = useDocusaurusContext();
+
+  const currentEvent = (siteConfig.customFields.events[currentLocale]
+    || siteConfig.customFields.events.en) as EventInfo[];
+  const events = currentEvent.slice(0, 4).map((event) => {
     const publishTime = event.fileName.slice(0, 10);
     const fileNameArr = event.fileName.split('-');
     const url = `/blog/${fileNameArr.slice(0, 
3).join('/')}/${fileNameArr.slice(3).join('-')}`;
@@ -22,7 +25,7 @@ const Events: FC = () => {
         <time dateTime={publishTime}>{publishTime}</time>
         <h4>{event.title}</h4>
         <div>
-          Read More
+          <Translate id="homeEventsSection.component.readMore">Read 
More</Translate>
           <div className={style.arrow}>
             <svg width="50%" height="100%" viewBox="0 0 256 256">
               <polygon
@@ -53,7 +56,8 @@ const HomeEventsSection: FC = () => (
       <p>
         <Translate id="homeEventsSection.component.message.news">
           Stay up to date about all Apache APISIX® News,
-        </Translate>{' '}
+        </Translate>
+        {' '}
         <a href="/docs/general/join/">
           <Translate id="homeEventsSection.component.link.newsletter">
             subscribe to our newsletter.
diff --git a/website/static/data/events.zh.json 
b/website/static/data/events.zh.json
new file mode 100644
index 00000000000..0dd7000ee38
--- /dev/null
+++ b/website/static/data/events.zh.json
@@ -0,0 +1,169 @@
+[   
+  {
+    "title": "周报 (Jul 16 - Jul 31)",
+    "fileName": "2022-08-09-weekly-report-0731"
+    },
+    {
+    "title": "Biweekly Report (Jul 1 - Jul 15)",
+    "fileName": "2022-07-21-weekly-report-0715"
+    },
+    {
+    "title": "Biweekly Report (Jun 16 - Jun 30)",
+    "fileName": "2022-07-07-weekly-report-0630"
+    },
+    {
+    "title": "Biweekly Report|Explore the weeks of May 16th - May 31th",
+    "fileName": "2022-06-07-weekly-report-0607"
+    },
+  {
+  "title": "Biweekly Report|Explore the weeks of May 1st - May 15th",
+  "fileName": "2022-05-19-weekly-report-0519"
+  },
+  {
+    "title": "Biweekly Report|Explore the weeks of Apr 15th - Apr 30th",
+    "fileName": "2022-05-10-weekly-report-0510"
+  },
+  {
+    "title": "Biweekly Report|Explore the weeks of Apr 1st - Apr 14th",
+    "fileName": "2022-04-20-weekly-report-0420"
+  },
+  {
+    "title": "Apache APISIX Summit ASIA 2022",
+    "fileName": "2022-04-12-apisix-summit-asia-2022"
+  },
+  {
+    "title": "Biweekly Report|Explore the weeks of Mar 1st - Mar 14th",
+    "fileName": "2022-03-24-weekly-report-0314"
+  },
+  {
+    "title": "Biweekly Report|Explore the week of Feb 15th - Feb 28th",
+    "fileName": "2022-03-03-weekly-report-0228"
+  },
+  {
+    "title": "Biweekly Report|2.1-2.14 Feature Highlights Update in Progress",
+    "fileName": "2022-02-17-weekly-report-0214"
+  },
+  {
+    "title": "Webinar | APISIX × QingCloud Online Meetup",
+    "fileName": "2022-01-24-apisix-with-qingcloud-meetup"
+  },
+  {
+    "title": "Biweekly Report|1.1-1.16 Feature Highlights Update in Progress",
+    "fileName": "2022-01-19-weekly-report-0116"
+  },
+  {
+    "title": "Webinar | Apache APISIX × Apache ShardingSphere Online Meetup",
+    "fileName": "2022-01-11-apisix-with-shardingsphere-meetup"
+  },
+  {
+    "title": "Biweekly Report|12.16-12.31 Feature Highlights Update in 
Progress",
+    "fileName": "2022-01-05-weekly-report-1231"
+  },
+  {
+    "title": "Biweekly Report|12.1-12.15 Feature Highlights Update in 
Progress",
+    "fileName": "2021-12-20-weekly-report-1215"
+  },
+  {
+    "title": "Webinar | Apache APISIX × Apache RocketMQ Online Meetup",
+    "fileName": "2021-12-16-apisix-with-rocketmq-meetup"
+  },
+  {
+    "title": "Weekly Report|11.15-11.30 Feature Highlights Update in Progress",
+    "fileName": "2021-12-02-weekly-report-1130"
+  },{
+    "title": "Weekly Report|11.1-11.14 Feature Highlights Update in Progress",
+    "fileName": "2021-11-16-weekly-report-1114"
+  },
+  {
+    "title": "Weekly Report|10.15-10.31 Feature Highlights Update in Progress",
+    "fileName": "2021-11-02-weekly-report-1031"
+  },
+  {
+    "title": "Webinar | Apache APISIX × Apache SkyWalking Online Meetup",
+    "fileName": "2021-10-18-meetup"
+  },
+  {
+    "title": "Community Weekly|10.1-10.14 Feature Highlight Updates in 
Progress",
+    "fileName": "2021-10-14-weekly-report-1014"
+  },
+  {
+    "title": "New milestone for the Apache APISIX community - over 300 
contributors worldwide!",
+    "fileName": "2021-10-13-celebrating-300-contributors-of-apisix"
+  },
+  {
+    "title": "社区周报|新晋 committer 两位,功能亮点更新进行中",
+    "fileName": "2021-09-15-weekly-report"
+  },
+  {
+    "title": "Apache APISIX 2.9 Release",
+    "fileName": "2021-08-27-release-apache-apisix-2.9"
+  },
+  {
+    "title": "ApacheCon Asia 2021 Recap",
+    "fileName": "2021-08-24-shanghai-meetup-recap"
+  },
+  {
+    "title": "ApacheCon Asia 2021",
+    "fileName": "2021-08-23-ApacheCon-Asia-2021"
+  },
+  {
+    "title": "ApacheCon Asia 2021",
+    "fileName": "2021-08-23-ApacheCon-Asia-2021"
+  },
+  {
+    "title": "8.21 Apache APISIX Meetup (Shanghai)",
+    "fileName": "2021-08-21-shanghai-meetup"
+  },
+  {
+    "title": "ApacheCon Asia",
+    "fileName": "2021-07-25-apachecon-asia"
+  },
+  {
+    "title": "Release Apache APISIX Dashboard 2.7",
+    "fileName": "2021-06-15-release-apache-apisix-dashboard-2.7"
+  },
+  {
+    "title": "Release Apache APISIX Dashboard 2.6.1",
+    "fileName": "2021-05-27-release-apache-apisix-dashboard-2.6.1"
+  },
+  {
+    "title": "Release Apache APISIX 2.6",
+    "fileName": "2021-05-24-release-apache-apisix-2.6"
+  },
+  {
+    "title": "Release Apache APISIX Dashboard 2.6",
+    "fileName": "2021-04-22-release-apache-apisix-dashboard-2.6"
+  },
+  {
+    "title": "Release Apache APISIX 2.5",
+    "fileName": "2021-04-05-release-apache-apisix-2.5"
+  },
+  {
+    "title": "Release Apache APISIX Ingress Controller 0.4.0",
+    "fileName": "2021-03-12-release-apache-apisix-ingress-controller-0.4.0"
+  },
+  {
+    "title": "Release Apache APISIX 2.4",
+    "fileName": "2021-03-05-release-apache-apisix-2.4"
+  },
+  {
+    "title": "Release Apache APISIX Dashboard 2.4",
+    "fileName": "2021-02-12-release-apache-apisix-dashboard-2.4"
+  },
+  {
+    "title": "Release Apache APISIX Ingress Controller 0.3.0",
+    "fileName": "2021-02-11-release-apache-apisix-ingress-controller-0.3.0"
+  },
+  {
+    "title": "Release Apache APISIX 2.3",
+    "fileName": "2021-02-09-release-apache-apisix-2.3"
+  },
+  {
+    "title": "Release Apache APISIX Ingress Controller 0.2.0",
+    "fileName": "2021-01-19-release-apache-apisix-ingress-controller-0.2.0"
+  },
+  {
+    "title": "Release Apache APISIX Ingress Controller 0.1.0",
+    "fileName": "2020-12-23-release-apache-apisix-ingress-controller-0.1.0"
+  }
+]

Reply via email to