diff --git a/packages/auth/package.json b/packages/auth/package.json index 700875fba3a84599f3f30440612267123461598a..06361d609ea7d1e519dbc3b800a286607f76cc78 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -25,7 +25,6 @@ "vpu-common": "file:./vendor/common" }, "dependencies": { - "i18next": "^17.0.3", "lit-element": "^2.1.0" }, "scripts": { diff --git a/packages/auth/src/i18n.js b/packages/auth/src/i18n.js index a2380632e7095df7cc09dddf372598f5d6b5898c..02c88eb4fd48d17e453af6166addcd7583e92479 100644 --- a/packages/auth/src/i18n.js +++ b/packages/auth/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/auth/vendor/common b/packages/auth/vendor/common index b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7..378256b0ae92712fd5b8feed3a987cd014617c0b 160000 --- a/packages/auth/vendor/common +++ b/packages/auth/vendor/common @@ -1 +1 @@ -Subproject commit b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7 +Subproject commit 378256b0ae92712fd5b8feed3a987cd014617c0b