diff --git a/src/config.js b/src/config.js index 3281523f..09fbcf3e 100644 --- a/src/config.js +++ b/src/config.js @@ -28,3 +28,4 @@ iptables -A FORWARD -o wg0 -j ACCEPT; module.exports.WG_PRE_DOWN = process.env.WG_PRE_DOWN || ''; module.exports.WG_POST_DOWN = process.env.WG_POST_DOWN || ''; +module.exports.LANG = process.env.LANG || 'en'; diff --git a/src/lib/Server.js b/src/lib/Server.js index a76e0f47..fbefef91 100644 --- a/src/lib/Server.js +++ b/src/lib/Server.js @@ -17,6 +17,7 @@ const { WEBUI_HOST, RELEASE, PASSWORD, + LANG, } = require('../config'); module.exports = class Server { @@ -161,6 +162,9 @@ module.exports = class Server { const { address } = req.body; return WireGuard.updateClientAddress({ clientId, address }); })) + .get('/api/lang', (Util.promisify(async () => { + return LANG; + }))) .listen(PORT, WEBUI_HOST, () => { debug(`Listening on http://${WEBUI_HOST}:${PORT}`); diff --git a/src/www/index.html b/src/www/index.html index 0d0b52d9..0221f488 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -32,7 +32,8 @@ - Logout + {{$t("logout")}} + -
- + href="https://github.com/sponsors/WeeJeWel" target="_blank">{{$t("donate")}} + - + +