diff --git a/packages/person-select/package.json b/packages/person-select/package.json index f29a6239f965655dc28413e4914ec813ac56650f..49b088e97c8d77b73e94607af5201aaf54f4521f 100644 --- a/packages/person-select/package.json +++ b/packages/person-select/package.json @@ -26,7 +26,6 @@ "vpu-common": "file:./vendor/common" }, "dependencies": { - "i18next": "^17.0.3", "jquery": "^3.4.1", "lit-element": "^2.1.0", "select2": "^4.0.7" diff --git a/packages/person-select/rollup.config.js b/packages/person-select/rollup.config.js index 0e67955dac65aed3c5889feb7d32e3d3d36f12be..47c463085a3744dca27d72d8f2cba2616747d425 100644 --- a/packages/person-select/rollup.config.js +++ b/packages/person-select/rollup.config.js @@ -1,3 +1,4 @@ +import path from 'path'; import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import postcss from 'rollup-plugin-postcss'; @@ -19,7 +20,12 @@ export default { }, plugins: [ multiEntry(), - resolve(), + resolve({ + customResolveOptions: { + // ignore node_modules from vendored packages + moduleDirectory: path.join(process.cwd(), 'node_modules') + } + }), commonjs({ include: 'node_modules/**' }), diff --git a/packages/person-select/src/i18n.js b/packages/person-select/src/i18n.js index a2380632e7095df7cc09dddf372598f5d6b5898c..02c88eb4fd48d17e453af6166addcd7583e92479 100644 --- a/packages/person-select/src/i18n.js +++ b/packages/person-select/src/i18n.js @@ -1,29 +1,6 @@ -import i18next from 'i18next'; +import {createInstance} from 'vpu-common/i18next.js'; import de from './i18n/de/translation.json'; import en from './i18n/en/translation.json'; -const i18n = i18next.createInstance(); - -i18n.init({ - lng: 'de', - fallbackLng: ['de'], - debug: false, - initImmediate: false, // Don't init async - resources: { - en: {translation: en}, - de: {translation: de} - }, -}); - -console.assert(i18n.isInitialized); - -function dateTimeFormat(date, options) { - return new Intl.DateTimeFormat(i18n.languages, options).format(date); -} - -function numberFormat(number, options) { - return new Intl.NumberFormat(i18n.languages, options).format(number); -} - -export {i18n, dateTimeFormat, numberFormat}; +export const i18n = createInstance({en: en, de: de}, 'de', 'en'); \ No newline at end of file diff --git a/packages/person-select/vendor/auth b/packages/person-select/vendor/auth index 2752cf0ce9d1710792cc939f8b26f48641693516..a84042737467c0649c083746aa35b43613fdf64a 160000 --- a/packages/person-select/vendor/auth +++ b/packages/person-select/vendor/auth @@ -1 +1 @@ -Subproject commit 2752cf0ce9d1710792cc939f8b26f48641693516 +Subproject commit a84042737467c0649c083746aa35b43613fdf64a diff --git a/packages/person-select/vendor/common b/packages/person-select/vendor/common index b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7..378256b0ae92712fd5b8feed3a987cd014617c0b 160000 --- a/packages/person-select/vendor/common +++ b/packages/person-select/vendor/common @@ -1 +1 @@ -Subproject commit b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7 +Subproject commit 378256b0ae92712fd5b8feed3a987cd014617c0b