-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
118 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import i18n from 'i18next' | ||
import { initReactI18next } from 'react-i18next' | ||
|
||
// the translations | ||
// (tip move them in a JSON file and import them, | ||
// or even better, manage them separated from your code: https://react.i18next.com/guides/multiple-translation-files) | ||
const resources = { | ||
en: { | ||
translation: { | ||
'Custom Related Resource Link': 'Custom Related Resource Link', | ||
'Article Context': 'Article Context', | ||
'Grammarly': 'Grammarly', | ||
'Text Prediction': 'Text Prediction', | ||
'Text Similarity': 'Text Similarity', | ||
'Web Search': 'Web Search', | ||
} | ||
}, | ||
zh: { | ||
translation: { | ||
'Custom Related Resource Link': '自定义相关资源链接', | ||
'Article Context': '文章背景', | ||
'Grammarly': '语法检查', | ||
'Text Prediction': '文本预测', | ||
'Text Similarity': '文本相似度', | ||
'Web Search': '网页搜索', | ||
} | ||
} | ||
} | ||
|
||
i18n | ||
.use(initReactI18next) // passes i18n down to react-i18next | ||
.init({ | ||
resources, | ||
// lng: 'zh', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources | ||
// you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage | ||
// if you're using a language detector, do not define the lng option | ||
|
||
interpolation: { | ||
escapeValue: false // react already safes from xss | ||
} | ||
}) | ||
|
||
export default i18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters