Skip to content
Snippets Groups Projects
Commit ca674dc5 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Port to new i18next wrapper

parent 281e80bb
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@
"vpu-common": "file:./vendor/common"
},
"dependencies": {
"i18next": "^17.0.3",
"lit-element": "^2.1.0"
},
"scripts": {
......
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
common @ 378256b0
Subproject commit b30eaa6475ccc65b5f99d2ead86ddbe2b8e015a7
Subproject commit 378256b0ae92712fd5b8feed3a987cd014617c0b
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment