Skip to content
Snippets Groups Projects
Commit dde0f634 authored by esikkala's avatar esikkala
Browse files

Locale files: support also js format

parent c5d8a1bc
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,14 @@ const { portalID, localeConfig, documentFinderConfig } = portalConfig
const { documentFinderAPIUrl } = documentFinderConfig
export const availableLocales = {}
for (const locale of localeConfig.availableLocales) {
availableLocales[locale.id] = await import(`../translations/${portalID}/${locale.filename}`)
let localeObj
if (locale.format && locale.format === 'js') {
const localeModule = await import(`../translations/${portalID}/${locale.filename}`)
localeObj = localeModule.default
} else {
localeObj = await import(`../translations/${portalID}/${locale.filename}`)
}
availableLocales[locale.id] = localeObj
}
/*
......
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