1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 13:00:05 +00:00

feat(auth): added multi-language support to logIn method

This commit is contained in:
Yury
2024-06-20 17:15:05 +03:00
parent 4c4511913c
commit 053b07769a
9 changed files with 169 additions and 14 deletions

View File

@@ -0,0 +1,10 @@
interface IEnavigator {
userLanguage?: string
}
/**
* Provides preferred language of the user.
* @returns A string representing the preferred language of the user, usually the language of the browser UI. Examples of valid language codes include "en", "en-US", "fr", "fr-FR", "es-ES". More info available https://datatracker.ietf.org/doc/html/rfc5646
*/
export const getUserLanguage = () =>
window.navigator.language || (window.navigator as IEnavigator).userLanguage

View File

@@ -20,3 +20,4 @@ export * from './serialize'
export * from './splitChunks'
export * from './validateInput'
export * from './getFormData'
export * from './getUserLanguage'