2019-06-29 09:38:24 +02:00
|
|
|
import i18n from '@ohif/i18n';
|
2019-06-27 12:01:11 +02:00
|
|
|
import locales from './locales';
|
2019-06-07 20:35:54 +02:00
|
|
|
|
2019-06-30 22:47:12 +02:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-29 09:38:24 +02:00
|
|
|
i18n.addLocales(locales);
|
2019-06-07 20:35:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default loadLocales;
|