mirror of https://github.com/vector-im/riot-web
Merge pull request #2658 from matrix-org/bwindels/moarcachebustin
Cache-bust languages.json with file-loaderpull/21833/head
commit
6455334bd0
|
@ -15,6 +15,9 @@ module.exports = {
|
|||
"flowtype",
|
||||
"babel"
|
||||
],
|
||||
globals: {
|
||||
LANGUAGES_FILE: "readonly",
|
||||
},
|
||||
env: {
|
||||
es6: true,
|
||||
},
|
||||
|
|
|
@ -23,5 +23,5 @@ ln -s "$REACT_SDK_DIR/node_modules/matrix-js-sdk" node_modules/matrix-js-sdk
|
|||
rm -r node_modules/matrix-react-sdk
|
||||
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
|
||||
|
||||
npm run build
|
||||
RIOT_LANGUAGES_FILE="../riot-web/webapp/i18n/languages.json" npm run build
|
||||
popd
|
||||
|
|
|
@ -338,8 +338,10 @@ export function getCurrentLanguage() {
|
|||
|
||||
function getLangsJson() {
|
||||
return new Promise((resolve, reject) => {
|
||||
// LANGUAGES_FILE is a webpack compile-time define, see webpack config
|
||||
const url = (typeof LANGUAGES_FILE === "string") ? require(LANGUAGES_FILE) : (i18nFolder + 'languages.json');
|
||||
request(
|
||||
{ method: "GET", url: i18nFolder + 'languages.json' },
|
||||
{ method: "GET", url },
|
||||
(err, response, body) => {
|
||||
if (err || response.status < 200 || response.status >= 300) {
|
||||
reject({err: err, response: response});
|
||||
|
|
Loading…
Reference in New Issue