Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
chore(examples): update event context (#8814)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuebit committed Nov 9, 2022
1 parent 10c2272 commit f26c97f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/other/locale/composables/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export const useDefaultLocale = (fallback = 'en-US') => {
const locale = ref(fallback)
if (process.server) {
// Learn more about the nuxtApp interface on https://v3.nuxtjs.org/docs/usage/nuxt-app#nuxtapp-interface-advanced
const nuxtApp = useNuxtApp()
const reqLocale = nuxtApp.ssrContext?.req.headers['accept-language']?.split(',')[0]
const reqLocale = useRequestHeaders()['accept-language']?.split(',')[0]
if (reqLocale) {
locale.value = reqLocale
}
Expand Down

0 comments on commit f26c97f

Please sign in to comment.