diff --git a/.babelrc b/.babelrc index 28397a1bd..5ac54d6c3 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,7 @@ { - "presets": [["@verdaccio"]] + "presets": [["@verdaccio"]], + "plugins": [ + "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-proposal-nullish-coalescing-operator" + ] } diff --git a/conf/default.yaml b/conf/default.yaml index dc3ad4083..1f33a39b7 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -71,3 +71,7 @@ logs: #experiments: # # support for npm token command # token: false + +# This affect the web and api (not developed yet) +#i18n: +#web: en-US diff --git a/package.json b/package.json index f0225883e..010628233 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@verdaccio/local-storage": "^9.3.4", "@verdaccio/readme": "^9.3.3", "@verdaccio/streams": "^9.3.2", - "@verdaccio/ui-theme": "^0.3.13", + "@verdaccio/ui-theme": "^1.0.0", "JSONStream": "1.3.5", "async": "3.1.1", "body-parser": "1.19.0", diff --git a/src/api/web/index.ts b/src/api/web/index.ts index b77ce1658..e0f3431e1 100644 --- a/src/api/web/index.ts +++ b/src/api/web/index.ts @@ -80,10 +80,11 @@ export default function(config, auth, storage) { const { url_prefix } = config; const uri = `${protocol}://${host}`; const base = combineBaseUrl(protocol, host, url_prefix); + const languageWeb = config?.i18n?.web ?? 'es-US'; const primaryColor = _.get(config, 'web.primary_color') ? config.web.primary_color : ''; const title = _.get(config, 'web.title') ? config.web.title : WEB_TITLE; const scope = _.get(config, 'web.scope') ? config.web.scope : ''; - const options = { uri, protocol, host, url_prefix, base, primaryColor, title, scope }; + const options = { uri, protocol, host, url_prefix, base, primaryColor, title, scope, language: languageWeb }; const webPage = template .replace(/ToReplaceByVerdaccioUI/g, JSON.stringify(options)) diff --git a/yarn.lock b/yarn.lock index c9929faba..0d5d10181 100644 Binary files a/yarn.lock and b/yarn.lock differ