mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Get browser language
This commit is contained in:
parent
d491c1bad6
commit
33f0459883
@ -22,7 +22,10 @@ export default ({ app, req, cookie, store }) => {
|
||||
if (process.server) return
|
||||
|
||||
const newLocale = mutation.payload.locale
|
||||
const currentLocale = await app.$cookies.get(key)
|
||||
let currentLocale = await app.$cookies.get(key)
|
||||
if (!currentLocale) {
|
||||
currentLocale = navigator.language.split('-')[0] // get browser language
|
||||
}
|
||||
const isDifferent = newLocale !== currentLocale
|
||||
|
||||
if (!isDifferent) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user