I would like to achieve automatic switching of the website to a client’s preferred language.
I have attempted to save the preferred language to local storage. If the URL is accessed in the default language (via a QR code), the website language should automatically change to the preferred language.
Here are the steps:
In a museum, many QR codes will be placed in the default language.
After the first scan, if the visitor changes their language preference, it will be saved to local storage.
When the visitor scans the next QR code (still in the default language), I aim to render the website in the language already saved in their local storage.
How can I ensure that this transition is very smooth?
This is an older project, and I am using the Rainlab.Translate plugin.
I would like to achieve to not load the full DOM in default language, then after reload in preferred language.
I would like to reload as early as I can, to achieve the best possible user experience.