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
@@ -410,11 +410,12 @@ export function pickBestLanguage(langs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
let url;
|
let url;
|
||||||
try {
|
try {
|
||||||
// $webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
// $webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
||||||
url = require('$webapp/i18n/languages.json');
|
url = import('$webapp/i18n/languages.json');
|
||||||
|
if (url.then) url = (await url).default; // webpack resolves to a Module through a promise.
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
url = i18nFolder + 'languages.json';
|
url = i18nFolder + 'languages.json';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user