Adjust i18next options for current (#2672)
This commit is contained in:
parent
2c244bfd11
commit
70045a9b85
@ -329,7 +329,7 @@
|
||||
"keypair crypto type": "тип криптопары",
|
||||
"last block": "последний блок",
|
||||
"lifetime": "продолжительность жизни",
|
||||
"lng.detect": "lng.detect",
|
||||
"lng.detect": "",
|
||||
"locked": "закрыт",
|
||||
"logs": "логи",
|
||||
"manage hardware connections": "управление соединений оборудования",
|
||||
|
||||
@ -5,5 +5,5 @@
|
||||
import { useTranslation as useTranslationBase, UseTranslationResponse } from 'react-i18next';
|
||||
|
||||
export function useTranslation (): UseTranslationResponse {
|
||||
return useTranslationBase('apps');
|
||||
return useTranslationBase(['apps', 'apps-routing']);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
"codeflask": "^1.4.1",
|
||||
"i18next": "^19.4.4",
|
||||
"i18next-browser-languagedetector": "^4.1.1",
|
||||
"i18next-xhr-backend": "^3.2.2",
|
||||
"i18next-http-backend": "^1.0.7",
|
||||
"react": "^16.13.1",
|
||||
"react-beautiful-dnd": "^13.0.0",
|
||||
"react-chartjs-2": "^2.9.0",
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
import i18n from 'i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import Backend from 'i18next-xhr-backend';
|
||||
import HttpApi from 'i18next-http-backend';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
|
||||
import uiSettings, { LANGUAGE_DEFAULT } from '@polkadot/ui-settings';
|
||||
@ -23,12 +23,12 @@ languageDetector.addDetector({
|
||||
});
|
||||
|
||||
i18n
|
||||
.use(Backend)
|
||||
.use(languageDetector)
|
||||
.use(initReactI18next)
|
||||
.use(HttpApi)
|
||||
.init({
|
||||
backend: {
|
||||
loadPath: 'locales/{{lng}}/{{ns}}.json'
|
||||
loadPath: 'locales/{{lng}}/translation.json'
|
||||
},
|
||||
debug: false,
|
||||
detection: {
|
||||
@ -40,41 +40,13 @@ i18n
|
||||
},
|
||||
keySeparator: false,
|
||||
load: 'languageOnly',
|
||||
ns: [
|
||||
'app-123code',
|
||||
'app-accounts',
|
||||
'app-claims',
|
||||
'app-contracts',
|
||||
'app-council',
|
||||
'app-dashboard',
|
||||
'app-democracy',
|
||||
'app-explorer',
|
||||
'app-extrinsics',
|
||||
'app-generic-asset',
|
||||
'app-js',
|
||||
'app-parachains',
|
||||
'app-settings',
|
||||
'app-society',
|
||||
'app-staking',
|
||||
'app-storage',
|
||||
'app-sudo',
|
||||
'app-tech-comm',
|
||||
'app-toolbox',
|
||||
'app-treasury',
|
||||
'apps',
|
||||
'apps-config',
|
||||
'apps-routing',
|
||||
'react-api',
|
||||
'react-components',
|
||||
'react-hooks',
|
||||
'react-params',
|
||||
'react-query',
|
||||
'react-signer'
|
||||
],
|
||||
ns: ['translation'],
|
||||
nsSeparator: false,
|
||||
react: {
|
||||
wait: true
|
||||
}
|
||||
},
|
||||
returnEmptyString: false,
|
||||
returnNull: false
|
||||
})
|
||||
.catch((error: Error): void =>
|
||||
console.log('i18n: failure', error)
|
||||
|
||||
34
yarn.lock
34
yarn.lock
@ -3316,7 +3316,7 @@ __metadata:
|
||||
codeflask: ^1.4.1
|
||||
i18next: ^19.4.4
|
||||
i18next-browser-languagedetector: ^4.1.1
|
||||
i18next-xhr-backend: ^3.2.2
|
||||
i18next-http-backend: ^1.0.7
|
||||
react: ^16.13.1
|
||||
react-beautiful-dnd: ^13.0.0
|
||||
react-chartjs-2: ^2.9.0
|
||||
@ -11502,6 +11502,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"i18next-http-backend@npm:^1.0.7":
|
||||
version: 1.0.7
|
||||
resolution: "i18next-http-backend@npm:1.0.7"
|
||||
dependencies:
|
||||
node-fetch: 2.6.0
|
||||
checksum: 2/e10d9af7ae97583d18f14e51197a59e790eed170982fe61362bb290e7d2f5e485181af5bb1c7e5431435942b372d74cb268a129e57eb6edcc2750f18e16c1283
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"i18next-scanner@npm:^2.11.0":
|
||||
version: 2.11.0
|
||||
resolution: "i18next-scanner@npm:2.11.0"
|
||||
@ -11532,15 +11541,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"i18next-xhr-backend@npm:^3.2.2":
|
||||
version: 3.2.2
|
||||
resolution: "i18next-xhr-backend@npm:3.2.2"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.5.5
|
||||
checksum: 2/83dfcfe844b27760a76a0fd5f7900c386534d2f2119876e3aa660f28acd33ed6ba24f8b6499f238cd09214d90a375ffe20f8cec2ba792c20aaacb9527356f4b3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"i18next@npm:*, i18next@npm:^19.4.4":
|
||||
version: 19.4.4
|
||||
resolution: "i18next@npm:19.4.4"
|
||||
@ -15234,6 +15234,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"node-fetch@npm:2.6.0, node-fetch@npm:^2.3.0, node-fetch@npm:^2.5.0":
|
||||
version: 2.6.0
|
||||
resolution: "node-fetch@npm:2.6.0"
|
||||
checksum: 2/dd9f586a9f7ddb7dd94d2aba9cb693d32f5001e9850098512fbc8a4cbdd56838afa08ed0a6725b9fce9b01ec12b713e622cbfc16d92762d8b937b238330a632a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"node-fetch@npm:^1.0.1":
|
||||
version: 1.7.3
|
||||
resolution: "node-fetch@npm:1.7.3"
|
||||
@ -15244,13 +15251,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"node-fetch@npm:^2.3.0, node-fetch@npm:^2.5.0":
|
||||
version: 2.6.0
|
||||
resolution: "node-fetch@npm:2.6.0"
|
||||
checksum: 2/dd9f586a9f7ddb7dd94d2aba9cb693d32f5001e9850098512fbc8a4cbdd56838afa08ed0a6725b9fce9b01ec12b713e622cbfc16d92762d8b937b238330a632a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"node-forge@npm:0.9.0":
|
||||
version: 0.9.0
|
||||
resolution: "node-forge@npm:0.9.0"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user