mirror of
https://github.com/mmjee/Piped-Material.git
synced 2024-12-06 19:26:36 +01:00
Add RTL support
This commit is contained in:
+11
-6
@@ -172,12 +172,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$store.state.prefs.prefs.darkMode' (newVal) {
|
||||
this.$vuetify.theme.dark = newVal
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeLocale (lang) {
|
||||
return changeLocale(lang)
|
||||
@@ -192,9 +186,20 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
'$store.state.prefs.prefs.darkMode' (newVal) {
|
||||
this.$vuetify.theme.dark = newVal
|
||||
},
|
||||
|
||||
'$store.state.i18n.rtl' (newVal) {
|
||||
this.$vuetify.rtl = newVal
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.$store.dispatch('prefs/loadState')
|
||||
this.$store.dispatch('auth/initializeAuth')
|
||||
this.$vuetify.rtl = this.$store.state.i18n.rtl
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -31,6 +31,7 @@ export const COUNTRY_I18N_EXCEPTIONS = {
|
||||
'zh-Hans': 'zh'
|
||||
}
|
||||
|
||||
// Similar switches for RTL can be found in the i18n store
|
||||
async function syncStylesPerLanguage (locale) {
|
||||
switch (locale) {
|
||||
// All the latin languages
|
||||
|
||||
+12
-2
@@ -4,7 +4,8 @@ export const i18nStore = {
|
||||
fullFormatter: null,
|
||||
dateFormatter: null,
|
||||
NF: null,
|
||||
timeAgo: null
|
||||
timeAgo: null,
|
||||
rtl: false
|
||||
}),
|
||||
|
||||
mutations: {
|
||||
@@ -17,8 +18,17 @@ export const i18nStore = {
|
||||
dateStyle: 'long'
|
||||
})
|
||||
state.NF = new Intl.NumberFormat(window.localStorage.getItem('NF_OVERRIDE') || intlLocale)
|
||||
|
||||
state.timeAgo = timeAgo
|
||||
|
||||
switch (intlLocale) {
|
||||
case 'ar':
|
||||
case 'ckb':
|
||||
state.rtl = true
|
||||
break
|
||||
default:
|
||||
state.rtl = false
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user