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
+14 -13
View File
@@ -14,20 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { createApp } from 'vue'
import App from './App.vue'
import { i18n, loadLanguage } from './i18n'
import getCurrentLanguage from './utils/currentLanguage'
import router from './router'
import { createApp } from 'vue';
import App from './App.vue';
import { i18n, loadLanguage, fallbackLocale } from './i18n';
import getCurrentLanguage from './utils/currentLanguage';
import router from './router';
import './styles/common.css'
import './styles/variables/colors.css'
import './styles/common.css';
import './styles/variables/colors.css';
(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.
await loadLanguage(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.
createApp(App)
.use(router)
.use(i18n)
.mount('#app')
})()
createApp(App)
.use(router)
.use(i18n)
.mount('#app');
})();