update deps
This commit is contained in:
34
node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/localStorage.js
generated
vendored
Normal file
34
node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/localStorage.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var hasLocalStorageSupport = void 0;
|
||||
try {
|
||||
hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
|
||||
var testKey = 'i18next.translate.boo';
|
||||
window.localStorage.setItem(testKey, 'foo');
|
||||
window.localStorage.removeItem(testKey);
|
||||
} catch (e) {
|
||||
hasLocalStorageSupport = false;
|
||||
}
|
||||
|
||||
exports.default = {
|
||||
name: 'localStorage',
|
||||
|
||||
lookup: function lookup(options) {
|
||||
var found = void 0;
|
||||
|
||||
if (options.lookupLocalStorage && hasLocalStorageSupport) {
|
||||
var lng = window.localStorage.getItem(options.lookupLocalStorage);
|
||||
if (lng) found = lng;
|
||||
}
|
||||
|
||||
return found;
|
||||
},
|
||||
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
||||
if (options.lookupLocalStorage && hasLocalStorageSupport) {
|
||||
window.localStorage.setItem(options.lookupLocalStorage, lng);
|
||||
}
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user