You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fix languageHandler's use of $webapp languages.json for Jest
This commit is contained in:
@@ -419,9 +419,9 @@ export function pickBestLanguage(langs) {
|
|||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let url;
|
let url;
|
||||||
try {
|
if (typeof(webpackLangJsonUrl) === 'string') { // in Jest this 'url' isn't a URL, so just fall through
|
||||||
url = webpackLangJsonUrl;
|
url = webpackLangJsonUrl;
|
||||||
} catch (e) {
|
} else {
|
||||||
url = i18nFolder + 'languages.json';
|
url = i18nFolder + 'languages.json';
|
||||||
}
|
}
|
||||||
request(
|
request(
|
||||||
|
|||||||
Reference in New Issue
Block a user