All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.detectNavigatorLanguage.js Maven / Gradle / Ivy

import { DEFAULT_LANGUAGE } from "../generated/AssetParameters.js";
const isSSR = typeof document === "undefined";
const detectNavigatorLanguage = () => {
    if (isSSR) {
        return DEFAULT_LANGUAGE;
    }
    const browserLanguages = navigator.languages;
    const navigatorLanguage = () => {
        return navigator.language;
    };
    const rawLocale = (browserLanguages && browserLanguages[0]) || navigatorLanguage();
    return rawLocale || DEFAULT_LANGUAGE;
};
export default detectNavigatorLanguage;
//# sourceMappingURL=detectNavigatorLanguage.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy