Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lang] add useBrowserLang #422

Closed
kiaking opened this issue Dec 20, 2023 · 0 comments · Fixed by #432
Closed

[Lang] add useBrowserLang #422

kiaking opened this issue Dec 20, 2023 · 0 comments · Fixed by #432
Labels
enhancement New feature or request

Comments

@kiaking
Copy link
Member

kiaking commented Dec 20, 2023

Get user locale from browser settings. This is GB specific feature on how we handle the param. What we do is this.

import { useNavigatorLanguage } from '@vueuse/core'

const { language: browserLang } = useNavigatorLanguage()

return (browserLang.value === 'ja' || browserLang.value === 'ja-JP') ? 'ja' : 'en'
// API
function useBrowserLang(): Ref<Lang>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant