feat: replace our home-grown gantt implementation with ganttastic #2180

Merged
konrad merged 78 commits from feature/ganttastic into main 2022-10-27 16:03:27 +00:00
1 changed files with 8 additions and 9 deletions
Showing only changes of commit abc26496cf - Show all commits

View File

@ -49,18 +49,17 @@ export async function loadLanguageAsync(lang: SupportedLocale) {
throw new Error()
}
if (
// If the same language
i18n.global.locale === lang ||
// If the language was already loaded
i18n.global.availableLocales.includes(lang)
) {
return setI18nLanguage(lang)
// do not change language to the current one
if (i18n.global.locale === lang) {
return
}
// If the language hasn't been loaded yet
const messages = await import(`./lang/${lang}.json`)
i18n.global.setLocaleMessage(lang, messages.default)
if (!i18n.global.availableLocales.includes(lang)) {
const messages = await import(`./lang/${lang}.json`)
i18n.global.setLocaleMessage(lang, messages.default)
}
return setI18nLanguage(lang)
}