@ohif/i18n: Fix issues with exports and update docs (#598)
* update i18n version -- already published * update ohif/i18n version and add modules * update ohif/i18n version * update translating documentation * replace addLocales method and exported modules * lock files * Update index.js * fix(@ohif/i18n): export custom methods in the main i18n object `initI18n`, `addLocales` and `T` are now being exported inside the main `i18n` object. * remove unecessary dependencies * update vtk-extension lock file
This commit is contained in:
1 parent
cb565427b3
commit
16cea8681e
8 files changed
+278
-351
No files matched your search
@@ -6,8 +6,6 @@ import pkg from '../package.json';
|
||||
import { debugMode, detectionOptions } from './config';
|
||||
import locales from './locales';
|
||||
|
||||
let translate;
|
||||
|
||||
function addLocales(newLocales) {
|
||||
customDebug(`Adding locales ${newLocales}`, 'info');
|
||||
|
||||
@@ -44,8 +42,8 @@ function initI18n(detection = detectionOptions) {
|
||||
},
|
||||
})
|
||||
.then(function(t) {
|
||||
translate = t;
|
||||
customDebug(`t function available.`, 'info');
|
||||
i18n.T = t;
|
||||
customDebug(`T function available.`, 'info');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -53,6 +51,7 @@ customDebug(`version ${pkg.version} loaded.`, 'info');
|
||||
|
||||
initI18n();
|
||||
|
||||
export { translate as t, addLocales, initI18n };
|
||||
i18n.initI18n = initI18n;
|
||||
i18n.addLocales = addLocales;
|
||||
|
||||
export default i18n;
|
||||
Reference in new issue
Block a user