diff --git a/src/components/header.js b/src/components/header.js index 516ba13..22f2918 100644 --- a/src/components/header.js +++ b/src/components/header.js @@ -11,9 +11,9 @@ const { Header } = Layout; const MyHeader = () => { const { t } = useTranslation(); - const [language, setLanguage] = useState('zh'); + const [language, setLanguage] = useState(i18n.language); const changeLanguage = () => { - let lan = language; + let lan; if (language == 'zh') { lan = 'en'; message.info('switched to English'); @@ -34,7 +34,7 @@ const MyHeader = () => { - + 中/En @@ -48,8 +48,13 @@ const MyHeader = () => { {t('loading')} + {t('loading')} -
@@ -58,6 +63,7 @@ const MyHeader = () => { style={{ height: '48px', width: '48px', cursor: 'pointer' }} onClick={changeLanguage} src="/pics/translation.png" + alt={t('loading')} />
diff --git a/src/locales/en.json b/src/locales/en.json index 25e0321..7a4f5b3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -12,7 +12,7 @@ "item": "Item: ", "region": "Region: ", "developer": "Developer", - "loading": "loading", + "loading": "Loading", "month": "Monthly", "year": "Yearly", "rank": "Rank", @@ -32,13 +32,13 @@ "open_pulls": "Open PRs", "merge_pulls": "Merge PRs", "pr_reviews": "PR Reviews", - "analysisConclusion": "The table below shows the OpenIsight-Index rankings for GitHub activity and influence up to end of November 2021. Positions are compared to the rankings at the end of October. As for activity The top 4 leading organizations remain consistent this month with QingCloud progressing well above their closest neighbour’s growth figures,Contrastingly Alibaba, JD and Bytedance also see a decline in their activity this month. As for influence... ", + "analysisConclusion": "The table below shows the OpenInsight-Index rankings for GitHub activity and influence up to end of November 2021. Positions are compared to the rankings at the end of October. As for activity The top 4 leading organizations remain consistent this month with QingCloud progressing well above their closest neighbour’s growth figures,Contrastingly Alibaba, JD and Bytedance also see a decline in their activity this month. As for influence... ", "contributeProject": "miss your project?", "contributeCompany": "miss your company?", "tip": "miss your item?", "introduction": "Welcome to OpenInsight-Index, where Chinese companies, projects and robot accounts are ranked by the activity and influence on GitHub.", "updateTime": "Updated December 1st, 2021", - "openinsight": "Openinsight is a complete set of tools integrating open source data collection, open source data development and open source data visualization. It can solve the open source data analysis and reporting in a one-stop way. It has a professional and in-depth understanding of various indicators of various open source projects to help the community operate reasonably.", + "openinsight": "OpenInsight is a complete set of tools integrating open source data collection, open source data development and open source data visualization. It can solve the open source data analysis and reporting in a one-stop way. It has a professional and in-depth understanding of various indicators of various open source projects to help the community operate reasonably.", "opendigger": "OpenDigger is an open source analysis report project for all open source data initiated by X-lab, this project aims to combine the wisdom of global developers to jointly analyze and insight into open source related data to help everyone better understand and participate in open source.", "Question": { "Q1": "Your business or project is not here, and how to add it?",