mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-11 22:46:44 +08:00
Add localeDirection method to i18n.js
Add dir to html tag based on localeDirection Add Farsi to the languages
This commit is contained in:
22
src/App.vue
22
src/App.vue
@@ -3,5 +3,25 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
|
||||
import { i18n, localeDirection } from "./i18n";
|
||||
|
||||
export default {
|
||||
created() {
|
||||
|
||||
this.setPageLocale();
|
||||
},
|
||||
methods: {
|
||||
setPageLocale() {
|
||||
const html = document.documentElement
|
||||
html.setAttribute('lang', this.$i18n.locale )
|
||||
html.setAttribute('dir', localeDirection() )
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"$i18n.locale"() {
|
||||
this.setPageLocale();
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user