Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(improvement) Language options #511

Merged
merged 5 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 44 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"history": "^4.9.0",
"i18next": "15.0.7",
"i18next-browser-languagedetector": "3.0.1",
"i18next-xhr-backend": "2.0.1",
"i18next-http-backend": "1.4.0",
"lightweight-charts": "^1.2.1",
"lodash": "4.17.21",
"memoize-one": "^5.0.2",
Expand Down
26 changes: 16 additions & 10 deletions src/locales/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,47 @@
// refer https://github.com/bitfinexcom/bfxuilib/blob/master/functions/i18n.spa.js

import i18n from 'i18next'
import backend from 'i18next-xhr-backend'
import backend from 'i18next-http-backend'
import detector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'

const { REACT_APP_ENV } = process.env

export const LANGUAGES = {
en: 'en',
es: 'es-EM',
pt: 'pt-PT',
'en-US': 'en',
ru: 'ru',
tr: 'tr',
cn: 'zh-CN',
tw: 'zh-TW',
tr: 'tr',
es: 'es-EM',
pt: 'pt-BR',
'pt-PT': 'pt-BR',
'pt-BR': 'pt-BR',
}

export const LANGUAGE_NAMES = {
en: 'English',
es: 'Español',
pt: 'Português',
ru: 'Русский',
tr: 'Türk',
cn: '中文 (简化)',
tw: '中文 (繁體)',
tr: 'Türkçe',
es: 'Español',
pt: 'Português',
}

// email templates language mapping
export const LANGUAGES_MAP = {
en: 'en',
es: 'es-EM',
pt: 'pt-PT',
'en-US': 'en',
ru: 'ru',
tr: 'tr',
cn: 'zh-CN',
tw: 'zh-TW',
es: 'es-EM',
tr: 'tr',
pt: 'pt-BR',
'pt-PT': 'pt-BR',
'pt-BR': 'pt-BR',
}

i18n
Expand Down