@jupyterlab/translation
Advanced tools
Comparing version 3.6.0-rc.0 to 3.6.0-rc.1
@@ -23,7 +23,24 @@ // Copyright (c) Jupyter Development Team. | ||
async fetch(locale) { | ||
var _a, _b; | ||
this._currentLocale = locale; | ||
var _a, _b, _c, _d; | ||
this._languageData = await this._connector.fetch({ language: locale }); | ||
this._domainData = ((_a = this._languageData) === null || _a === void 0 ? void 0 : _a.data) || {}; | ||
const message = (_b = this._languageData) === null || _b === void 0 ? void 0 : _b.message; | ||
if (this._languageData && locale === 'default') { | ||
try { | ||
for (const lang of Object.values((_a = this._languageData.data) !== null && _a !== void 0 ? _a : {})) { | ||
this._currentLocale = | ||
// If the language is provided by the system set up, we need to retrieve the final | ||
// language. This is done through the `""` entry in `_languageData` that contains | ||
// language metadata. | ||
lang['']['language'].replace('_', '-'); | ||
break; | ||
} | ||
} | ||
catch (reason) { | ||
this._currentLocale = 'en'; | ||
} | ||
} | ||
else { | ||
this._currentLocale = locale; | ||
} | ||
this._domainData = (_c = (_b = this._languageData) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : {}; | ||
const message = (_d = this._languageData) === null || _d === void 0 ? void 0 : _d.message; | ||
if (message && locale !== 'en') { | ||
@@ -30,0 +47,0 @@ console.warn(message); |
{ | ||
"name": "@jupyterlab/translation", | ||
"version": "3.6.0-rc.0", | ||
"version": "3.6.0-rc.1", | ||
"description": "JupyterLab - Translation services", | ||
@@ -42,9 +42,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@jupyterlab/coreutils": "^5.6.0-rc.0", | ||
"@jupyterlab/services": "^6.6.0-rc.0", | ||
"@jupyterlab/statedb": "^3.6.0-rc.0", | ||
"@jupyterlab/coreutils": "^5.6.0-rc.1", | ||
"@jupyterlab/services": "^6.6.0-rc.1", | ||
"@jupyterlab/statedb": "^3.6.0-rc.1", | ||
"@lumino/coreutils": "^1.11.0" | ||
}, | ||
"devDependencies": { | ||
"@jupyterlab/testutils": "^3.6.0-rc.0", | ||
"@jupyterlab/testutils": "^3.6.0-rc.1", | ||
"@types/jest": "^26.0.10", | ||
@@ -51,0 +51,0 @@ "jest": "^26.4.2", |
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
57340
1136