diff --git a/Dockerfile b/Dockerfile index f1115d02..3978fcf1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,9 +75,9 @@ FROM zoeyvid/nginx-quic:350-python SHELL ["/bin/ash", "-eo", "pipefail", "-c"] COPY rootfs / COPY --from=zoeyvid/certbot-docker:59 /usr/local /usr/local -COPY --from=zoeyvid/curl-quic:420 /usr/local/bin/curl /usr/local/bin/curl +COPY --from=zoeyvid/curl-quic:423 /usr/local/bin/curl /usr/local/bin/curl -ARG CRS_VER=v4.7.0 +ARG CRS_VER=v4.8.0 RUN apk upgrade --no-cache -a && \ apk add --no-cache ca-certificates tzdata tini \ nodejs \ diff --git a/README.md b/README.md index f0702773..b4be6995 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ so that the barrier for entry here is low. - Supports PUID/PGID in network mode host; add `net.ipv4.ip_unprivileged_port_start=0` at the end of `/etc/sysctl.conf` - Option to set IP bindings for multiple instances in network mode host - Option to change backend port +- multi lang support, if you want to add an language, see this commit as an example: https://github.com/ZoeyVid/NPMplus/commit/a026b42329f66b89fe1fbe5e6034df5d3fc2e11f - See the composefile for all available options - If you want to redirect all HTTP traffic to HTTPS, you can use the `compose.override.yaml` file. diff --git a/frontend/js/app/cache.js b/frontend/js/app/cache.js index 6d1fbc4f..17e60def 100644 --- a/frontend/js/app/cache.js +++ b/frontend/js/app/cache.js @@ -2,7 +2,7 @@ const UserModel = require('../models/user'); let cache = { User: new UserModel.Model(), - locale: 'en', + locale: navigator.languages[0].toLowerCase(), version: null }; diff --git a/frontend/js/app/i18n.js b/frontend/js/app/i18n.js index c63cdc07..048d21e4 100644 --- a/frontend/js/app/i18n.js +++ b/frontend/js/app/i18n.js @@ -1,5 +1,4 @@ -const Cache = ('./cache'); -const messages = require('../i18n/messages.json'); +const Cache = require('./cache'); /** * @param {String} namespace @@ -8,16 +7,11 @@ const messages = require('../i18n/messages.json'); */ module.exports = function (namespace, key, data) { let locale = Cache.locale; - // check that the locale exists - if (typeof messages[locale] === 'undefined') { - locale = 'en'; - } + messages = require('../i18n/en-lang.json'); - if (typeof messages[locale][namespace] !== 'undefined' && typeof messages[locale][namespace][key] !== 'undefined') { - return messages[locale][namespace][key](data); - } else if (locale !== 'en' && typeof messages['en'][namespace] !== 'undefined' && typeof messages['en'][namespace][key] !== 'undefined') { - return messages['en'][namespace][key](data); + if (typeof messages[namespace] !== 'undefined' && typeof messages[namespace][key] !== 'undefined') { + return messages[namespace][key](data); + } else { + return `(MISSING: ${namespace}.${key})`; } - - return '(MISSING: ' + namespace + '/' + key + ')'; }; diff --git a/frontend/js/app/nginx/certificates-list-item.ejs b/frontend/js/app/nginx/certificates-list-item.ejs index aa4b53ad..89ed8c81 100644 --- a/frontend/js/app/nginx/certificates-list-item.ejs +++ b/frontend/js/app/nginx/certificates-list-item.ejs @@ -3,16 +3,16 @@
<%- i18n('ssl', 'processing-info') %>
+<%- i18n('tls', 'processing-info') %>