diff --git a/.eslintrc.js b/.eslintrc.js index fdf0bb351e8c..b47b1caf30ab 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,7 +16,7 @@ module.exports = { "babel" ], globals: { - LANGUAGES_FILE: "readonly", + LANGUAGES_INDEX_URL: "readonly", }, env: { es6: true, diff --git a/src/languageHandler.js b/src/languageHandler.js index 33f703c204ac..4d52853f5e62 100644 --- a/src/languageHandler.js +++ b/src/languageHandler.js @@ -338,9 +338,9 @@ export function getCurrentLanguage() { function getLangsJson() { return new Promise((resolve, reject) => { - // LANGUAGES_FILE is a webpack compile-time define, see webpack config + // LANGUAGES_INDEX_URL is a webpack compile-time define, see webpack config request( - { method: "GET", url: require(LANGUAGES_FILE) }, + { method: "GET", url: LANGUAGES_INDEX_URL }, (err, response, body) => { if (err || response.status < 200 || response.status >= 300) { reject({err: err, response: response}); diff --git a/test/i18n-test/languageHandler-test.js b/test/i18n-test/languageHandler-test.js index ce9f8e1684d8..0c45fd5e7aac 100644 --- a/test/i18n-test/languageHandler-test.js +++ b/test/i18n-test/languageHandler-test.js @@ -1,6 +1,7 @@ const React = require('react'); const expect = require('expect'); import * as languageHandler from '../../src/languageHandler'; +global.LANGUAGES_INDEX_URL = "i18n/languages.json"; const testUtils = require('../test-utils');