From 0c62dfc8eddff330e90760c2795670fd8406d2e1 Mon Sep 17 00:00:00 2001 From: Haifeng Luo Date: Sun, 10 Apr 2022 11:20:06 +0800 Subject: [PATCH] Improve i18n. --- web/src/WordsetEditPage.js | 4 ++-- web/src/WordsetListPage.js | 18 +++++++++--------- web/src/locales/en/data.json | 6 +++--- web/src/locales/zh/data.json | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/web/src/WordsetEditPage.js b/web/src/WordsetEditPage.js index 1c30592..895f82d 100644 --- a/web/src/WordsetEditPage.js +++ b/web/src/WordsetEditPage.js @@ -86,11 +86,11 @@ class WordsetEditPage extends React.Component { - {i18next.t("wordset:Vectors")}: + {i18next.t("wordset:Words")}: { this.updateWordsetField('vectors', value)}} /> diff --git a/web/src/WordsetListPage.js b/web/src/WordsetListPage.js index 93326ae..628d938 100644 --- a/web/src/WordsetListPage.js +++ b/web/src/WordsetListPage.js @@ -99,7 +99,7 @@ class WordsetListPage extends React.Component { sorter: (a, b) => a.distance - b.distance, }, { - title: i18next.t("wordset:Vectors"), + title: i18next.t("wordset:Words"), dataIndex: 'vectors', key: 'vectors', // width: '120px', @@ -109,21 +109,21 @@ class WordsetListPage extends React.Component { } }, { - title: i18next.t("wordset:All vectors"), - dataIndex: 'allVectors', - key: 'allVectors', + title: i18next.t("wordset:All words"), + dataIndex: 'allWords', + key: 'allWords', width: '140px', - sorter: (a, b) => a.allVectors - b.allVectors, + sorter: (a, b) => a.allWords - b.allWords, render: (text, record, index) => { return record.vectors.length; } }, { - title: i18next.t("wordset:Valid vectors"), - dataIndex: 'validVectors', - key: 'validVectors', + title: i18next.t("wordset:Valid words"), + dataIndex: 'validWords', + key: 'validWords', width: '140px', - sorter: (a, b) => a.validVectors - b.validVectors, + sorter: (a, b) => a.validWords - b.validWords, render: (text, record, index) => { return record.vectors.filter(vector => vector.data.length !== 0).length; } diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 0f29ccc..bc99a04 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -31,10 +31,10 @@ "File size": "File size" }, "wordset": { - "All vectors": "All vectors", + "All words": "All words", "Distance": "Distance", "Edit Wordset": "Edit Wordset", - "Valid vectors": "Valid vectors", - "Vectors": "Vectors" + "Valid words": "Valid words", + "Words": "Words" } } \ No newline at end of file diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index dea65fb..9fc60fd 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -31,10 +31,10 @@ "File size": "文件大小" }, "wordset": { - "All vectors": "所有向量", + "All words": "所有词汇", "Distance": "距离", "Edit Wordset": "编辑词汇集", - "Valid vectors": "有效向量", - "Vectors": "向量" + "Valid words": "有效词汇", + "Words": "词汇表" } } \ No newline at end of file