@tolgee/core
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -12,4 +12,5 @@ import { TolgeeConfig } from './TolgeeConfig'; | ||
set preferredLanguages(languages: Set<string>); | ||
private getInitialLanguage; | ||
private getStoredLanguage; | ||
private getLanguageByNavigator; | ||
} |
@@ -12,18 +12,6 @@ var PREFERRED_LANGUAGES_LOCAL_STORAGE_KEY = '__tolgee_preferredLanguages'; | ||
} | ||
if (this._currentLanguage) { | ||
return this._currentLanguage; | ||
if (!this._currentLanguage) { | ||
this._currentLanguage = this.getInitialLanguage(); | ||
} | ||
if (this.config.enableLanguageStore) { | ||
var storedLanguage = this.getStoredLanguage(); | ||
if (storedLanguage) { | ||
return storedLanguage; | ||
} | ||
} | ||
if (this.config.enableLanguageDetection) { | ||
var detectedLanguage = this.getLanguageByNavigator(); | ||
if (detectedLanguage) { | ||
return detectedLanguage; | ||
} | ||
} | ||
return this.config.defaultLanguage; | ||
return this._currentLanguage; | ||
}, | ||
@@ -54,2 +42,17 @@ set: function (language) { | ||
}); | ||
Properties.prototype.getInitialLanguage = function () { | ||
if (this.config.enableLanguageStore) { | ||
var storedLanguage = this.getStoredLanguage(); | ||
if (storedLanguage) { | ||
return storedLanguage; | ||
} | ||
} | ||
if (this.config.enableLanguageDetection) { | ||
var detectedLanguage = this.getLanguageByNavigator(); | ||
if (detectedLanguage) { | ||
return detectedLanguage; | ||
} | ||
} | ||
return this.config.defaultLanguage; | ||
}; | ||
Properties.prototype.getStoredLanguage = function () { | ||
@@ -56,0 +59,0 @@ if (typeof localStorage !== 'undefined') { |
{ | ||
"name": "@tolgee/core", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "Library providing ability to translate messages directly in context of developed application.", | ||
@@ -64,3 +64,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "7196475ac0ea7705b932bce82024a98c23348c9f", | ||
"gitHead": "28988e4c3b6bdd3143ff4ca03de7c1e18dc84d4c", | ||
"publishConfig": { | ||
@@ -67,0 +67,0 @@ "access": "public" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3284705
22264