diff --git a/README.md b/README.md index d237d191..b6c7997b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ To automatically install & run wg-easy, simply run:
 $ docker run -d \
   --name=wg-easy \
+  -e LANG=de
   -e WG_HOST=🚨YOUR_SERVER_IP \
   -e PASSWORD=🚨YOUR_ADMIN_PASSWORD \
   -v ~/.wg-easy:/etc/wireguard \
diff --git a/docker-compose.yml b/docker-compose.yml
index d9ddcf7c..d59aa9cf 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -5,6 +5,9 @@ volumes:
 services:
   wg-easy:
     environment:
+      # Change Language:
+      # (Supports: en, ru, tr, no, pl, fr, de)
+      - LANG=de
       # ⚠️ Required:
       # Change this to your host's public address
       - WG_HOST=raspberrypi.local
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 d5bbc787..149aa69d 100644
--- a/src/www/index.html
+++ b/src/www/index.html
@@ -26,7 +26,8 @@
         
-          Logout
+          {{$t("logout")}}
+
           
             
           
-

There is an update available!

+

{{$t("updateAvailable")}}

{{latestRelease.changelog}}

- Update → + {{$t("update")}} →
@@ -58,7 +59,7 @@
-

Clients

+

{{$t("clients")}}

@@ -88,7 +89,6 @@ style="transform: scaleY(-1);">
-
@@ -112,7 +112,7 @@
+ :title="$t('createdOn') + dateTime(new Date(client.createdAt))"> - + · @@ -177,7 +177,7 @@ - + · @@ -190,7 +190,7 @@ + :title="$t('lastSeen') + dateTime(new Date(client.latestHandshakeAt))"> · {{new Date(client.latestHandshakeAt) | timeago}}
@@ -201,19 +201,22 @@
-
-
+
+

@@ -334,13 +338,13 @@

+ type="text" v-model.trim="clientCreateName" :placeholder="$t('name')" />

@@ -349,15 +353,15 @@
@@ -409,12 +413,11 @@

- Are you sure you want to delete {{clientDelete.name}}? - This action cannot be undone. + {{$t("deleteDialog1")}} {{clientDelete.name}}? {{$t("deleteDialog2")}}

@@ -423,11 +426,11 @@
@@ -448,7 +451,7 @@ -