mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-06 12:10:04 +00:00
11 lines
474 B
TypeScript
11 lines
474 B
TypeScript
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
|