New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jswork/i18n-language-detect

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jswork/i18n-language-detect - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

8

dist/index.d.ts

@@ -5,4 +5,4 @@ /*!

* homepage: https://js.work
* version: 1.0.8
* date: 2023-08-28 11:07:18
* version: 1.0.9
* date: 2023-09-06 16:21:42
* license: MIT

@@ -17,2 +17,4 @@ */

routerType?: string;
supportedLngs?: string[];
fallbackLng?: string;
}

@@ -25,5 +27,5 @@ declare class I18nLanguageDetect {

init(services: any, inOptions: I18nLanguageDetectOptions): void;
detect(): string | null;
detect(): string | null | undefined;
cacheUserLanguage(lng: string): void;
}
export default I18nLanguageDetect;

@@ -5,4 +5,4 @@ /*!

* homepage: https://js.work
* version: 1.0.8
* date: 2023-08-28 11:07:16
* version: 1.0.9
* date: 2023-09-06 16:21:41
* license: MIT

@@ -41,2 +41,4 @@ */

routerType: 'hash',
supportedLngs: ['zh-CN', 'en-US'],
fallbackLng: 'en-US',
};

@@ -73,7 +75,8 @@ var getLanguage = function (keys, inOptions) {

I18nLanguageDetect.prototype.detect = function () {
var _a = this.options, lookupQuerystring = _a.lookupQuerystring, languageQueryFn = _a.languageQueryFn, store = _a.store;
var _a = this.options, lookupQuerystring = _a.lookupQuerystring, languageQueryFn = _a.languageQueryFn, store = _a.store, supportedLngs = _a.supportedLngs, fallbackLng = _a.fallbackLng;
var lang = languageQueryFn
? languageQueryFn()
: getLanguage(lookupQuerystring, this.options);
return lang || navigator.language || store.getItem(this.cacheKey);
var resLang = lang || navigator.language || store.getItem(this.cacheKey);
return supportedLngs.includes(resLang) ? resLang : fallbackLng;
};

@@ -80,0 +83,0 @@ I18nLanguageDetect.prototype.cacheUserLanguage = function (lng) {

@@ -6,4 +6,4 @@ "use strict";

* homepage: https://js.work
* version: 1.0.8
* date: 2023-08-28 11:07:18
* version: 1.0.9
* date: 2023-09-06 16:21:42
* license: MIT

@@ -43,2 +43,4 @@ */

routerType: 'hash',
supportedLngs: ['zh-CN', 'en-US'],
fallbackLng: 'en-US',
};

@@ -75,7 +77,8 @@ var getLanguage = function (keys, inOptions) {

I18nLanguageDetect.prototype.detect = function () {
var _a = this.options, lookupQuerystring = _a.lookupQuerystring, languageQueryFn = _a.languageQueryFn, store = _a.store;
var _a = this.options, lookupQuerystring = _a.lookupQuerystring, languageQueryFn = _a.languageQueryFn, store = _a.store, supportedLngs = _a.supportedLngs, fallbackLng = _a.fallbackLng;
var lang = languageQueryFn
? languageQueryFn()
: getLanguage(lookupQuerystring, this.options);
return lang || navigator.language || store.getItem(this.cacheKey);
var resLang = lang || navigator.language || store.getItem(this.cacheKey);
return supportedLngs.includes(resLang) ? resLang : fallbackLng;
};

@@ -82,0 +85,0 @@ I18nLanguageDetect.prototype.cacheUserLanguage = function (lng) {

{
"name": "@jswork/i18n-language-detect",
"version": "1.0.9",
"version": "1.0.10",
"description": "Language detect plugin.",

@@ -55,3 +55,3 @@ "main": "dist/index.js",

},
"gitHead": "dedde88468fb7d4a613524d65d3ad2b649075c69"
"gitHead": "eb1bf35d538d0e4730062d3df0879512808b6f51"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc