@ohif/extension-vtk 0.1.3: Wait for i18n to be initialized before adding resources
This commit is contained in:
parent
e2ec11c83e
commit
6a98550c43
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-vtk",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.3",
|
||||
"description": "OHIF extension for VTK.js",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@ -20,7 +20,7 @@
|
||||
"lint": "eslint -c .eslintrc --fix src && prettier --single-quote --write src/**/*.{js,jsx,json,css}"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ohif/i18n": "0.1.1",
|
||||
"@ohif/i18n": "0.2.2",
|
||||
"cornerstone-core": "^2.2.8",
|
||||
"cornerstone-wado-image-loader": "^2.2.3",
|
||||
"dcmjs": "^0.4.7",
|
||||
|
||||
@ -1,7 +1,19 @@
|
||||
import i18n from '@ohif/i18n';
|
||||
import locales from './locales';
|
||||
|
||||
function loadLocales() {
|
||||
async function loadLocales() {
|
||||
// Note: We should wait for the i18n initializing
|
||||
// promise to complete before adding any new
|
||||
// resources to i18next. If the resources are added
|
||||
// to i18next before initialization is complete, the
|
||||
// backend values (e.g. those from Locize) will not
|
||||
// be loaded properly.
|
||||
try {
|
||||
await i18n.initializing;
|
||||
} catch(error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
|
||||
i18n.addLocales(locales);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user