Use webpack alias to resolve the languages file
Hopefully this will end up simpler than having to figure out in riot-web what the relative path is from react-sdk's src/languageHandler.js to riot-web's webapp directory.pull/21833/head
parent
52a2fe1c9c
commit
63c6f600bf
|
@ -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
|
rm -r node_modules/matrix-react-sdk
|
||||||
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
|
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
|
||||||
|
|
||||||
RIOT_LANGUAGES_FILE="../riot-web/webapp/i18n/languages.json" npm run build
|
npm run build
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -338,8 +338,8 @@ export function getCurrentLanguage() {
|
||||||
|
|
||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// LANGUAGES_FILE is a webpack compile-time define, see webpack config
|
// Webapp is a webpack resolve alias pointing to the output directory, see webpack config
|
||||||
const url = (typeof LANGUAGES_FILE === "string") ? require(LANGUAGES_FILE) : (i18nFolder + 'languages.json');
|
const url = require('Webapp/i18n/languages.json');
|
||||||
request(
|
request(
|
||||||
{ method: "GET", url },
|
{ method: "GET", url },
|
||||||
(err, response, body) => {
|
(err, response, body) => {
|
||||||
|
|
Loading…
Reference in New Issue