Currently, I am utilizing Vue.js along with vue-i18n to seamlessly switch between languages on my project without the necessity of refreshing the page. Nevertheless, when transitioning from Arabic to another language or vice versa, it requires changing the website's design direction from right-to-left to left-to-right.
The current setup necessitates a refresh to load the rtl.scss file:
Below is the code responsible for loading CSS upon refresh:
let locale = VueCookie.get('locale') || 'en'
if (locale === 'ar') {
require('rtl.scss')
}
This next code snippet triggers a page refresh:
if (newLocale === 'ar' || oldLocale === 'ar') {
window.location.reload()
}