mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-13 22:48:31 -05:00
feat: i18n on web (#1750)
* feat: add i18n to web * chore: enable es features
This commit is contained in:
parent
981efa5571
commit
c493b316b1
5 changed files with 16 additions and 12 deletions
6
.babelrc
6
.babelrc
|
@ -1,3 +1,7 @@
|
||||||
{
|
{
|
||||||
"presets": [["@verdaccio"]]
|
"presets": [["@verdaccio"]],
|
||||||
|
"plugins": [
|
||||||
|
"@babel/plugin-proposal-optional-chaining",
|
||||||
|
"@babel/plugin-proposal-nullish-coalescing-operator"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,3 +71,7 @@ logs:
|
||||||
#experiments:
|
#experiments:
|
||||||
# # support for npm token command
|
# # support for npm token command
|
||||||
# token: false
|
# token: false
|
||||||
|
|
||||||
|
# This affect the web and api (not developed yet)
|
||||||
|
#i18n:
|
||||||
|
#web: en-US
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"@verdaccio/local-storage": "^9.3.4",
|
"@verdaccio/local-storage": "^9.3.4",
|
||||||
"@verdaccio/readme": "^9.3.3",
|
"@verdaccio/readme": "^9.3.3",
|
||||||
"@verdaccio/streams": "^9.3.2",
|
"@verdaccio/streams": "^9.3.2",
|
||||||
"@verdaccio/ui-theme": "^0.3.13",
|
"@verdaccio/ui-theme": "^1.0.0",
|
||||||
"JSONStream": "1.3.5",
|
"JSONStream": "1.3.5",
|
||||||
"async": "3.1.1",
|
"async": "3.1.1",
|
||||||
"body-parser": "1.19.0",
|
"body-parser": "1.19.0",
|
||||||
|
|
|
@ -80,10 +80,11 @@ export default function(config, auth, storage) {
|
||||||
const { url_prefix } = config;
|
const { url_prefix } = config;
|
||||||
const uri = `${protocol}://${host}`;
|
const uri = `${protocol}://${host}`;
|
||||||
const base = combineBaseUrl(protocol, host, url_prefix);
|
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 primaryColor = _.get(config, 'web.primary_color') ? config.web.primary_color : '';
|
||||||
const title = _.get(config, 'web.title') ? config.web.title : WEB_TITLE;
|
const title = _.get(config, 'web.title') ? config.web.title : WEB_TITLE;
|
||||||
const scope = _.get(config, 'web.scope') ? config.web.scope : '';
|
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
|
const webPage = template
|
||||||
.replace(/ToReplaceByVerdaccioUI/g, JSON.stringify(options))
|
.replace(/ToReplaceByVerdaccioUI/g, JSON.stringify(options))
|
||||||
|
|
13
yarn.lock
13
yarn.lock
|
@ -1969,10 +1969,10 @@
|
||||||
resolved "https://registry.verdaccio.org/@verdaccio%2fui-theme/-/ui-theme-0.3.9.tgz#6ff0f05315912b4ba39e29eb589ecc8833640990"
|
resolved "https://registry.verdaccio.org/@verdaccio%2fui-theme/-/ui-theme-0.3.9.tgz#6ff0f05315912b4ba39e29eb589ecc8833640990"
|
||||||
integrity sha512-InTpEowYo6M9TjpQh4cVh/HZH1DW9oyhy8UpC1H4FOwvyknctN0dMavOseKWSrPAj+gPDzUw0IKAvwDI4OcPEg==
|
integrity sha512-InTpEowYo6M9TjpQh4cVh/HZH1DW9oyhy8UpC1H4FOwvyknctN0dMavOseKWSrPAj+gPDzUw0IKAvwDI4OcPEg==
|
||||||
|
|
||||||
"@verdaccio/ui-theme@^0.3.13":
|
"@verdaccio/ui-theme@^1.0.0":
|
||||||
version "0.3.13"
|
version "1.0.0"
|
||||||
resolved "https://registry.verdaccio.org/@verdaccio%2fui-theme/-/ui-theme-0.3.13.tgz#e6f06907b0940c47883f35861723012437b7b958"
|
resolved "https://registry.verdaccio.org/@verdaccio%2fui-theme/-/ui-theme-1.0.0.tgz#53706449fdb2e66e06a22867deb3efedf6ddc9d2"
|
||||||
integrity sha512-3nDT5iJvmIYJe8UwirJbHexy21HU0YUkwvKygVe2KCPUTQu8u23/w6JyOB8reqj8w0xFfJMHI0dArnPsKxYM3Q==
|
integrity sha512-gUggtAV9lOa2SmhYZmRRd/AGR5HmZ+N3uGoXnZXVjPckTetE/fsB8mqkSYZCk0SrO767j82JGhyU8O/JVKM8jw==
|
||||||
|
|
||||||
"@yarnpkg/lockfile@^1.1.0":
|
"@yarnpkg/lockfile@^1.1.0":
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
|
@ -6578,11 +6578,6 @@ mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist "0.0.8"
|
minimist "0.0.8"
|
||||||
|
|
||||||
mkdirp@1.0.3:
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
|
|
||||||
integrity sha512-6uCP4Qc0sWsgMLy1EOqqS/3rjDHOEnsStVr/4vtAIK2Y5i2kA7lFFejYrpIyiN9w0pYf4ckeCYT9f1r1P9KX5g==
|
|
||||||
|
|
||||||
mkdirp@1.0.3:
|
mkdirp@1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.verdaccio.org/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
|
resolved "https://registry.verdaccio.org/mkdirp/-/mkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea"
|
||||||
|
|
Loading…
Add table
Reference in a new issue