Skip to content
Snippets Groups Projects
Verified Commit 5602e488 authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Improved i18n and cleaned up user teams view

- i18n will now scan the locales folder for languages and will no longer crash when language file includes invalid JSON
- src/routes/(user)/teams/[slug]/+page.svelte had an old 'form' variable, now cleaned up
parent 45c566c6
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,17 @@ import { init, register } from 'svelte-i18n';
const defaultLocale = 'en';
register('en', () => import('./locales/en.json'));
//register('nl', () => import('./locales/nl.json'));
const languages = import.meta.glob('./locales/*.json');
for (const language in languages) {
const lang = language.replace('./locales/', '').replace('.json', '');
register(lang, () => {
return languages[language]()
.catch((e) => {
console.error(`Cannot load language "${lang}" since it includes invalid json code\n${e.frame}`);
return {};
});
});
}
init({
fallbackLocale: defaultLocale,
......
......@@ -83,6 +83,10 @@
"date": {
"placeholder": "Enter Playlist Date",
"label": "Playlist Date"
},
"team": {
"placeholder": "Select the owning Team",
"label": "Playlist owning Team"
}
},
"song": {
......
......@@ -17,9 +17,6 @@
const authUser = data.authUser;
$: team = data.team;
/** @type {import('./$types').ActionData} */
export let form;
getContext('title').set('teams.info');
let working = false;
......
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