Load the default language on startup #133

Merged
jakob.scheid merged 3 commits from fix/load-default-language into main 2026-07-21 19:59:06 +02:00
Showing only changes of commit d4363f7515 - Show all commits
+8 -2
View File
@@ -16,7 +16,7 @@ limitations under the License.
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import { i18n, loadLanguage } from './i18n' import { i18n, loadLanguage, fallbackLocale } from './i18n'
import getCurrentLanguage from './utils/currentLanguage' import getCurrentLanguage from './utils/currentLanguage'
import router from './router' import router from './router'
@@ -24,7 +24,13 @@ import './styles/common.css'
import './styles/variables/colors.css' import './styles/variables/colors.css'
(async () => { (async () => {
await loadLanguage(getCurrentLanguage()) await loadLanguage(fallbackLocale)
jakob.scheid marked this conversation as resolved Outdated
Outdated
Review

Please use a semicolon at the end of the line.

Please use a semicolon at the end of the line.
Outdated
Review

I will fix that.

I will fix that.
const currentLanguage = getCurrentLanguage()
jakob.scheid marked this conversation as resolved Outdated
Outdated
Review

This check is not necessary. loadLanguage already checks whether a language has already been loaded. If the language preferred by the user is the same as the fallback language, it is not redundantly fetched.

This check is not necessary. `loadLanguage` already checks whether a language has already been loaded. If the language preferred by the user is the same as the fallback language, it is not redundantly fetched.
if (currentLanguage !== fallbackLocale) {
await loadLanguage(currentLanguage)
}
createApp(App) createApp(App)
.use(router) .use(router)