mirror of https://github.com/vector-im/riot-web
Add fallback for languages file
So we're not completely dependent on the alias being setpull/21833/head
parent
63c6f600bf
commit
53aceaa412
|
@ -338,8 +338,13 @@ export function getCurrentLanguage() {
|
||||||
|
|
||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
let url;
|
||||||
const url = require('Webapp/i18n/languages.json');
|
try {
|
||||||
|
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
||||||
|
url; = require('Webapp/i18n/languages.json');
|
||||||
|
} catch (e) {
|
||||||
|
url = i18nFolder + 'languages.json';
|
||||||
|
}
|
||||||
request(
|
request(
|
||||||
{ method: "GET", url },
|
{ method: "GET", url },
|
||||||
(err, response, body) => {
|
(err, response, body) => {
|
||||||
|
|
Loading…
Reference in New Issue