mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Add fallback for languages file
So we're not completely dependent on the alias being set
This commit is contained in:
parent
63c6f600bf
commit
53aceaa412
1 changed files with 7 additions and 2 deletions
|
@ -338,8 +338,13 @@ export function getCurrentLanguage() {
|
|||
|
||||
function getLangsJson() {
|
||||
return new Promise((resolve, reject) => {
|
||||
let url;
|
||||
try {
|
||||
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
||||
const url = require('Webapp/i18n/languages.json');
|
||||
url; = require('Webapp/i18n/languages.json');
|
||||
} catch (e) {
|
||||
url = i18nFolder + 'languages.json';
|
||||
}
|
||||
request(
|
||||
{ method: "GET", url },
|
||||
(err, response, body) => {
|
||||
|
|
Loading…
Reference in a new issue