diff --git a/frontend/src/elements/Tag.vue b/frontend/src/elements/Tag.vue
index a14b9662..780d2ab4 100644
--- a/frontend/src/elements/Tag.vue
+++ b/frontend/src/elements/Tag.vue
@@ -5,7 +5,7 @@
- {{ tag[locale] ? tag[locale] : tag.key }}
+ {{ tag[loc] ? tag[loc] : tag.key }}
@@ -20,6 +20,7 @@ import { IconTag, IconX } from '@tabler/icons-vue';
// component constants
const { locale } = useI18n({ useScope: 'global' });
+const loc = locale.value.substring(0, 2);
// component properties
const props = defineProps({
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 03c0efa8..5f8656fd 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -39,7 +39,7 @@ const messages = {
'en': en, // English
};
const loc = !('lang' in localStorage)
- ? navigator.language || navigator.userLanguage
+ ? navigator.language.substring(0, 2) || navigator.userLanguage.substring(0, 2)
: localStorage.getItem('lang');
const i18n = createI18n({
legacy: false,
@@ -73,7 +73,7 @@ marked.use({
app.provide('marked', marked);
// extend Object for filtering
-Object.filter = (obj, predicate) =>
+Object.filter = (obj, predicate) =>
Object.keys(obj)
.filter(key => predicate(obj[key]))
.reduce((res, key) => (res[key] = obj[key], res), {});
diff --git a/frontend/src/modals/InfoSongSyntax.vue b/frontend/src/modals/InfoSongSyntax.vue
index 729ad646..3c451ed2 100644
--- a/frontend/src/modals/InfoSongSyntax.vue
+++ b/frontend/src/modals/InfoSongSyntax.vue
@@ -20,10 +20,11 @@ import Modal from '@/elements/Modal.vue';
// component constants
const { t, locale } = useI18n();
+const loc = locale.value.substring(0, 2);
// cheatsheet contents
const cheatsheets = { de, en };
-const lang = ['de', 'en'].includes(locale.value) ? locale.value : 'en';
+const lang = ['de', 'en'].includes(loc) ? loc : 'en';
// component properties
const props = defineProps({
diff --git a/frontend/src/modals/SetlistSet.vue b/frontend/src/modals/SetlistSet.vue
index b2dcfe39..d3d746bb 100644
--- a/frontend/src/modals/SetlistSet.vue
+++ b/frontend/src/modals/SetlistSet.vue
@@ -47,7 +47,7 @@
class="lg:hidden"
pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}"
/>
-
{{ humanDate(setlist.date, locale) }}
+ {{ humanDate(setlist.date, loc) }}
{{ t('error.requiredDate') }}
@@ -60,8 +60,8 @@
auto-apply
:dark="isDark"
:enable-time-picker="false"
- :locale="locale"
- :format-locale="calendarLanguage[locale]"
+ :locale="loc"
+ :format-locale="calendarLanguage[loc]"
@update:model-value="updateDate"
>
@@ -102,7 +102,7 @@
{
setlists.forEach(setlist => {
setlist.songs.forEach(song => {
if (!(song.id in songs)) {
- songs[song.id] = humanDate(setlist.date, locale.value, false);
+ songs[song.id] = humanDate(setlist.date, loc, false);
}
});
});
diff --git a/frontend/src/modals/TagAssign.vue b/frontend/src/modals/TagAssign.vue
index f9bbcc89..fdcf29f0 100644
--- a/frontend/src/modals/TagAssign.vue
+++ b/frontend/src/modals/TagAssign.vue
@@ -25,7 +25,7 @@
type="checkbox"
class="w-6 h-6 ml-2"
/>
- {{ tag[locale] ? tag[locale] : tag.key }}
+ {{ tag[loc] ? tag[loc] : tag.key }}
@@ -39,7 +39,7 @@
{{ t('text.selection') }}
- {{ tags[tag][locale] ? tags[tag][locale] : tag }}
+ {{ tags[tag][loc] ? tags[tag][loc] : tag }}
+
@@ -124,7 +124,7 @@
@@ -290,6 +290,7 @@ import {
// component constantes
const { t, locale } = useI18n();
+const loc = locale.value.substring(0, 2);
const route = useRoute();
const router = useRouter();
@@ -340,7 +341,7 @@ const isFiltered = computed(() => {
// pagination and sorting
const page = ref(0);
const listLength = 16;
-const order = reactive({
+const order = reactive({
field: 'title',
ascending: true
});