refactor: cleanup

This commit is contained in:
wea_ondara
2023-09-26 16:32:13 +02:00
parent a37d46fde4
commit 1882d43db3
2 changed files with 6 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
<script lang="ts">
import {Vue, Options} from 'vue-class-component';
import {setDocumentLocale} from '@/locale/locale';
import {Options, Vue} from 'vue-class-component';
import {Watch} from 'vue-property-decorator';
@Options({name: 'DocumentLocaleSetter'})
@@ -11,7 +10,11 @@ export default class DocumentLocaleSetter extends Vue {
@Watch('$i18n.locale')
onLocaleChanged(value: string): void {
setDocumentLocale(value);
this.setDocumentLocale(value);
}
setDocumentLocale(locale: string): void {
document.documentElement.setAttribute('lang', locale);
}
}
</script>

View File

@@ -22,7 +22,3 @@ export function createI18n(): I18n {
legacy: true,
});
}
export function setDocumentLocale(locale: string): void {
document.documentElement.setAttribute("lang", locale);
}