1
0
Fork 1
mirror of https://github.com/SomboChea/ui synced 2024-05-20 02:11:36 +07:00

Compare commits

...

20 Commits

Author SHA1 Message Date
Priscila Oliveira 254d35ab93
Merge branch 'master' into master 2020-05-07 21:32:18 +02:00
刘相轩 70bb6b5e65
Improve zh-CN translation (#476) 2020-05-07 21:29:48 +02:00
Sambo Chea 563a6677f6 fixed khmer language icon missing 2020-05-06 09:07:12 +07:00
Sambo Chea c2c94929a7 add cambodia flag (khmer) and cleanup 2020-05-05 19:27:53 +07:00
Sambo Chea 484543dabc updated translation config for khmer 2020-05-05 19:14:17 +07:00
Sambo Chea 3c5fd072f0 updated translation config for khmer 2020-05-05 19:14:11 +07:00
Sambo Chea 35be83f560 updated trans lanuages for khmer 2020-05-05 19:12:43 +07:00
Sambo Chea ee9ef143d2 completed file trans for khmer language 2020-05-05 19:09:42 +07:00
Sambo Chea b06ae66961 completed file trans for khmer language 2020-05-05 19:09:24 +07:00
Sambo Chea 57f45e7867 completed file trans for khmer language 2020-05-05 19:09:20 +07:00
Sambo Chea 37e3574fb1 copy trans en-US to km-KH for Cambodia (Khmer) 2020-05-05 18:40:42 +07:00
Gjorgji Jankovski 7e56c8e7e2
fix: when scope is provided use proper separator (#457) 2020-05-05 09:17:33 +02:00
Mykola b59840d352
add a new language - Ukrainian && fix bug with dayjs locale (#472) 2020-05-03 17:45:17 +02:00
Priscila Oliveira 2965973f77
ref(doc): replaced cs_cz with czech (#474) 2020-05-03 15:28:38 +02:00
hdmr14 c9910c97b0
fix: time format localization (#471) 2020-05-03 15:17:38 +02:00
Priscila Oliveira 1e060474c7
ref(doc): updated translation section (#473) 2020-05-03 08:21:59 +02:00
Jean-Francois Thuong f8101ae90a
fix: update zh-CN.json (#466)
Improve list of languages in Chinese (Simplified) and other misc improvements

Co-authored-by: Juan Picado <juanpicado19@gmail.com>
2020-05-02 09:35:08 +02:00
Jean-Francois Thuong bf54b4abab
Update fr-FR.json (#467)
Improve list of languages in French
2020-05-01 20:14:09 +02:00
Juan Picado @jotadeveloper 5e3c006cbd
chore(release): 1.7.1 2020-04-27 21:37:54 +02:00
Priscila Oliveira f44abd7dd0
fix(i18n): fixed current locale (#462)
* fix(i18n): fixed current locale

* Update i18n/translations/ja-JP.json

Co-Authored-By: hdmr14 <58992133+hdmr14@users.noreply.github.com>

Co-authored-by: hdmr14 <58992133+hdmr14@users.noreply.github.com>
2020-04-27 21:36:40 +02:00
27 changed files with 528 additions and 92 deletions

View File

@ -3,7 +3,7 @@
"files": null,
"lines": null
},
"generated_at": "2019-09-29T18:19:50Z",
"generated_at": "2020-05-05T12:14:08Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
@ -23,6 +23,7 @@
"name": "HexHighEntropyString"
},
{
"keyword_exclude": null,
"name": "KeywordDetector"
},
{
@ -36,5 +37,9 @@
}
],
"results": {},
"version": "0.12.4"
}
"version": "0.13.0",
"word_list": {
"file": null,
"hash": null
}
}

View File

@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [1.7.1](https://github.com/verdaccio/ui/compare/v1.7.0...v1.7.1) (2020-04-27)
### Bug Fixes
* **i18n:** fixed current locale ([#462](https://github.com/verdaccio/ui/issues/462)) ([f44abd7](https://github.com/verdaccio/ui/commit/f44abd7dd08a8d68b1bfc2bf0c053f3e80a343d0))
## [1.7.0](https://github.com/verdaccio/ui/compare/v1.6.0...v1.7.0) (2020-04-24)

View File

@ -105,6 +105,28 @@ If you have any issue you can try the following options, do no desist to ask or
Translations are handled locally. I18n files can be found in the folder ```i18n/translations/*``` of this repository. We would love to provide translations from other languages, embracing all our users, but unfortunately we cannot do this without your help. Would you like to help us? Please feel **super welcome** to add a locale by opening a pull request.
Your PR should contain:
1 - A json file in the folder ```i18n/translations/*``` with the translations. The file must be named according to the new added language
2 - The files ```i18n/config.ts``` and ```LanguageSwitch.tsx``` updated with the new language. Please see the current structure
3 - The other translations containing the new language in the language of the file. Example:
New language: ```cs_CZ ```
The file ```pt-BR ``` should contain:
```
"lng": {
...,
"czech": "Tcheco"
}
```
4 - A SVG flag of the new translated language in the the folder ```src/components/Icon/img/*```. You maybe want to compress the svg file using https://jakearchibald.github.io/svgomg/
### License
Verdaccio is [MIT licensed](https://github.com/verdaccio/verdaccio/blob/master/LICENSE)

View File

@ -8,6 +8,8 @@ import translationDE from './translations/de-DE.json';
import translationFR from './translations/fr-FR.json';
import translationCN from './translations/zh-CN.json';
import translationJP from './translations/ja-JP.json';
import translationUA from './translations/uk-UA.json';
import translationKM from './translations/km-KH.json';
const languages = {
'en-US': {
@ -31,6 +33,12 @@ const languages = {
'ja-JP': {
translation: translationJP,
},
'uk-UA': {
translation: translationUA,
},
'km-KH': {
translation: translationKM,
},
};
type Language = keyof typeof languages;
@ -44,7 +52,7 @@ i18n
// in case window.VEDACCIO_LANGUAGE is undefined,it will fall back to 'en-US'
lng: window?.__VERDACCIO_BASENAME_UI_OPTIONS?.language,
fallbackLng: 'en-US',
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE', 'fr-FR', 'zh-CN', 'ja-JP'],
whitelist: ['en-US', 'pt-BR', 'es-ES', 'de-DE', 'fr-FR', 'zh-CN', 'ja-JP', 'uk-UA', 'km-KH'],
load: 'currentOnly',
resources: languages,
debug: false,

View File

@ -138,11 +138,14 @@
},
"lng": {
"english": "Englisch",
"japanese": "Japanisch",
"portuguese": "Portugiesisch",
"spanish": "Spanisch",
"german": "Deutsch",
"chinese": "Chinesisch",
"french": "Französisch"
"french": "Französisch",
"ukraine": "Ukrainisch",
"khmer": "Khmer"
},
"help-to-translate": "Hilfe beim Übersetzen",
"change-language": "Sprache ändern"

View File

@ -138,12 +138,15 @@
},
"lng": {
"english": "English",
"japanese": "Japanese",
"portuguese": "Portuguese",
"spanish": "Spanish",
"german": "German",
"chinese": "Chinese",
"french": "French"
"french": "French",
"ukraine": "Ukraine",
"khmer": "Khmer"
},
"help-to-translate": "Help to translate",
"change-language": "Change language"
}
}

View File

@ -138,11 +138,14 @@
},
"lng": {
"english": "Inglés",
"japanese": "Japonés",
"portuguese": "Portugués",
"spanish": "Español",
"german": "Alemán",
"chinese": "Chino",
"french": "francés"
"french": "Francés",
"ukraine": "Ucraniano",
"khmer": "Khmer"
},
"help-to-translate": "Ayuda a traducir",
"change-language": "Cambiar idioma"

View File

@ -137,13 +137,16 @@
"package-meta-is-required-at-detail-context": "packageMeta est obligatoire à DetailContext"
},
"lng": {
"english": "Anglaise",
"portuguese": "Portugaise",
"english": "Anglais",
"japanese": "Japonais",
"portuguese": "Portugais",
"spanish": "Espagnol",
"german": "Allemande",
"chinese": "Chinoise",
"french": "Française"
"german": "Allemand",
"chinese": "Chinois",
"french": "Français",
"ukraine": "Ukrainien",
"khmer": "Khmer"
},
"help-to-translate": "Aide à traduire",
"help-to-translate": "Aide à la traduction",
"change-language": "Changer la langue"
}
}

View File

@ -135,5 +135,18 @@
"app-context-not-correct-used": "AppContextが正しく使用されませんでした",
"theme-context-not-correct-used": "ThemeContextが正しく使用されませんでした",
"package-meta-is-required-at-detail-context": "DetailContextではpackageMetaが必要です"
}
}
},
"lng": {
"english": "英語",
"japanese": "日本語",
"portuguese": "ポルトガル語",
"spanish": "スペイン語",
"german": "ドイツ語",
"chinese": "中国語",
"french": "フランス語",
"ukraine": "ウクライナ",
"khmer": "Khmer"
},
"help-to-translate": "翻訳を助ける",
"change-language": "言語を変更"
}

View File

@ -0,0 +1,152 @@
{
"copy-to-clipboard": "ចម្លងទៅក្ដារតម្បៀតខ្ទាស់",
"author-anonymous": "គ្មានអត្តសញ្ញាណ",
"action-bar-action": {
"visit-home-page": "ទស្សនាគេហទំព័រ",
"open-an-issue": "បើកកិច្ចការ",
"download-tarball": "ទាញយកកញ្ចប់ឯកសារ"
},
"dialog": {
"registry-info": {
"title": "ព័ត៌មានការចុះឈ្មោះ"
}
},
"header": {
"documentation": "ឯកសារ",
"registry-info": "ព័ត៌មានការចុះឈ្មោះ",
"greetings": "សួស្តី"
},
"search": {
"packages": "ស្វែងរកកញ្ចប់"
},
"auto-complete": {
"loading": "កំពុងផ្ទុក...",
"no-results-found": "រកមិនឃើញលទ្ធផល"
},
"tab": {
"uplinks": "ភ្ជាប់តំណទៅ",
"versions": "កំណែ",
"dependencies": "អាស្រ័យលើ",
"readme": "អានខ្ញុំជាមុនសិន"
},
"uplinks": {
"title": "ភ្ជាប់តំណទៅ",
"no-items": "{{name}} គ្មានភ្ជាប់តំណទៅ។"
},
"versions": {
"current-tags": "ស្លាកបច្ចុប្បន្ន",
"version-history": "ប្រវត្តិសាស្រ្តជំនាន់",
"not-available": "Not available"
},
"package": {
"published-on": "បោះពុម្ភផ្សាយ {{time}}។",
"version": "v{{version}}",
"visit-home-page": "ទស្សនាគេហទំព័រ",
"homepage": "គេហទំព័រ",
"open-an-issue": "បើកកិច្ចការ",
"bugs": "កំហុស",
"download": "ទាញយក {{what}}",
"the-tar-file": "ឯកសាជា tar",
"tarball": "ឯកសារ Tarball"
},
"dependencies": {
"has-no-dependencies": "{{package}} មិនមានភាពអាស្រ័យ។",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "ឈ្មោះអ្នកប្រើប្រាស់",
"password": "ពាក្យសម្ងាត់"
},
"form-placeholder": {
"username": "ឈ្មោះអ្នកប្រើរបស់អ្នក",
"password": "ពាក្យសម្ងាត់ខ្លាំងរបស់អ្នក"
},
"form-validation": {
"required-field": "ចន្លោះនេះត្រូវតែំពេញ",
"required-min-length": "ប្រអប់នេះទាមទារប្រវែងអប្បបរមា {{length}}",
"unable-to-sign-in": "មិនអាចចូលបានទេ",
"username-or-password-cant-be-empty": "ឈ្មោះអ្នកប្រើឬពាក្យសម្ងាត់មិនអាចទទេ!"
},
"help": {
"title": "មិនទាន់មានការបោះពុម្ពផ្សាយកញ្ចប់នៅឡើយទេ។",
"sub-title": "ដើម្បីផ្សព្វផ្សាយកញ្ចប់ដំបូងរបស់អ្នកគ្រាន់តែ៖",
"first-step": "1. ចូល",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. ផ្សព្វផ្សាយ",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "ផ្ទុកទំព័រនេះឡើងវិញ។"
},
"sidebar": {
"detail": {
"latest-version": "ចុងក្រោយ v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "ការដំឡើង",
"install-using-yarn": "ដំឡើងដោយប្រើ yarn",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "ដំឡើងដោយប្រើ npm",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "ដំឡើងដោយប្រើ pnpm",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "ឃ្លាំង"
},
"author": {
"title": "អ្នកនិពន្ធ"
},
"distribution": {
"title": "ការចែកចាយចុងក្រោយ",
"license": "អាជ្ញាប័ណ្ណ",
"size": "ទំហំ",
"file-count": "រាប់ឯកសារ"
},
"maintainers": {
"title": "អ្នកថែរក្សា"
},
"contributors": {
"title": "អ្នកចូលរួមអភិវឌ្ឍ"
},
"engines": {
"npm-version": "NPM កំណែ",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "ឧបត្ថម្ភដោយ",
"made-with-love-on": "ផលិតជាមួយ <0>♥</0> លើ"
},
"button": {
"close": "បិទ",
"cancel": "បោះបង់",
"login": "ចូល",
"logout": "ចាកចេញ",
"go-to-the-home-page": "ទៅទំព័រដើម",
"learn-more": "ស្វែងយល់បន្ថែម",
"fund-this-package": "<0>Fund</0> កញ្ចប់នេះ"
},
"error": {
"unspecific": "មានអ្វីមួយមិនប្រក្រតី។",
"404": {
"page-not-found": "៤០៤ - រកមិនឃើញទំព័រ",
"sorry-we-could-not-find-it": "សូមទោសយើងមិនអាចរកវាឃើញទេ..."
},
"app-context-not-correct-used": "បរិបទកម្មវិធីមិនត្រូវបានប្រើត្រឹមត្រូវទេ",
"theme-context-not-correct-used": "បរិបទទម្រង់មិនត្រូវបានប្រើត្រឹមត្រូវទេ",
"package-meta-is-required-at-detail-context": "packageMeta ត្រូវបានទាមទារនៅ DetailContext"
},
"lng": {
"english": "អង់គ្លេស",
"japanese": "ជប៉ុន",
"portuguese": "ព័រទុយហ្កាល់",
"spanish": "អេស្ប៉ាញ",
"german": "អាឡឺម៉ង់",
"chinese": "ចិន",
"french": "បារាំង",
"ukraine": "អ៊ុយក្រែន",
"khmer": "ខ្មែរ"
},
"help-to-translate": "ជួយបកប្រែ",
"change-language": "ប្ដូរភាសា"
}

View File

@ -138,12 +138,15 @@
},
"lng": {
"english": "Inglês",
"japanese": "Japonês",
"portuguese": "Português",
"spanish": "Espanhol",
"german": "Alemão",
"chinese": "Chinês",
"french": "Francês"
"french": "Francês",
"ukraine": "Ucraniano",
"khmer": "Khmer"
},
"help-to-translate": "Ajude a traduzir",
"change-language": "Mudar idioma"
}
}

View File

@ -0,0 +1,152 @@
{
"copy-to-clipboard": "Копіювати в буфер обміну",
"author-anonymous": "Анонімний",
"action-bar-action": {
"visit-home-page": "Відвідати домашню сторінку",
"open-an-issue": "Відкрити питання, проблему, ...",
"download-tarball": "Завантажити архів"
},
"dialog": {
"registry-info": {
"title": "Інформація про реєстр"
}
},
"header": {
"documentation": "Документація",
"registry-info": "Інформація про реєстр",
"greetings": "Привіт "
},
"search": {
"packages": "Пошук пакетів"
},
"auto-complete": {
"loading": "Завантаження...",
"no-results-found": "Нічого не знайдено"
},
"tab": {
"uplinks": "Публікації",
"versions": "Версії",
"dependencies": "Залежності",
"readme": "Опис"
},
"uplinks": {
"title": "Публікації",
"no-items": "{{name}} не опубліковано."
},
"versions": {
"current-tags": "Поточні теги",
"version-history": "Історія версій",
"not-available": "Недоступний"
},
"package": {
"published-on": "Опубліковано {{time}} •",
"version": "v{{version}}",
"visit-home-page": "Відвідати домашню сторінку",
"homepage": "Домашня сторінка",
"open-an-issue": "Відкрити питання, проблему, ...",
"bugs": "Помилки",
"download": "Завантажити {{what}}",
"the-tar-file": "файл tar",
"tarball": "Завантажити"
},
"dependencies": {
"has-no-dependencies": "{{package}} не має залежностей.",
"dependency-block": "{{package}}@{{version}}"
},
"form": {
"username": "Ім'я користувача",
"password": "Пароль"
},
"form-placeholder": {
"username": "Ваше ім'я користувача",
"password": "Ваш надійний пароль"
},
"form-validation": {
"required-field": "Це поле є обов'язковим",
"required-min-length": "Для цього поля потрібна мінімальна довжина {{length}}",
"unable-to-sign-in": "Неможливо ввійти",
"username-or-password-cant-be-empty": "Ім'я користувача або пароль не можуть бути порожніми !"
},
"help": {
"title": "Пакети ще не опубліковані",
"sub-title": "Опублікувати свій перший пакет просто:",
"first-step": "1. Підключіться",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. Опублікуйте",
"second-step-command-line": "npm publish --registry {{registryUrl}}",
"third-step": "3. Оновіть цю сторінку."
},
"sidebar": {
"detail": {
"latest-version": "Остання версія v{{version}}",
"version": "v{{version}}"
},
"installation": {
"title": "Встановлення",
"install-using-yarn": "Встановлення за допомогою yarn",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "Встановлення за допомогою npm",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "Встановлення за допомогою pnpm",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
"title": "Сховище"
},
"author": {
"title": "Автор"
},
"distribution": {
"title": "Умови поширення",
"license": "Ліцензія",
"size": "Розмір",
"file-count": "кількість файлів"
},
"maintainers": {
"title": "Технічне супроводження"
},
"contributors": {
"title": "Автори"
},
"engines": {
"npm-version": "NPM версія",
"node-js": "NODE JS"
}
},
"footer": {
"powered-by": "Працює на",
"made-with-love-on": "Зроблено з <0> ♥ </0> на"
},
"button": {
"close": "Закрити",
"cancel": "Скасувати",
"login": "Вхід",
"logout": "Вийти",
"go-to-the-home-page": "Перейдіть на головну сторінку",
"learn-more": "Вивчайте більше",
"fund-this-package": "<0>Фінансувати</0> цей пакет"
},
"error": {
"unspecific": "Щось пішло не так.",
"404": {
"page-not-found": "404 - Сторінку не знайдено",
"sorry-we-could-not-find-it": "На жаль, ми не змогли його знайти ..."
},
"app-context-not-correct-used": "Контекст програми не використовувався правильно",
"theme-context-not-correct-used": "Контекст теми використано неправильно",
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
},
"lng": {
"english": "Англійська",
"japanese": "Японська",
"portuguese": "Португальська",
"spanish": "Іспанська",
"german": "Німецька",
"chinese": "Китайська",
"french": "Французька",
"ukraine": "Українська",
"khmer": "Khmer"
},
"help-to-translate": "Допоможіть перекласти",
"change-language": "Змінити мову"
}

View File

@ -39,7 +39,7 @@
"not-available": "不可用"
},
"package": {
"published-on": "发于 {{time}} •",
"published-on": "发于 {{time}} •",
"version": "v{{version}}",
"visit-home-page": "访问主页",
"homepage": "主页",
@ -63,13 +63,13 @@
},
"form-validation": {
"required-field": "必填项",
"required-min-length": "长度不能小于{{length}}",
"required-min-length": "长度不能小于 {{length}}",
"unable-to-sign-in": "登录失败",
"username-or-password-cant-be-empty": "用户名或密码不能为空!"
},
"help": {
"title": "还没有发布任何NPM包.",
"sub-title": "发布第一个NPM包:",
"title": "还没有发布任何 NPM 包.",
"sub-title": "发布第一个 NPM 包:",
"first-step": "1. 登录",
"first-step-command-line": "npm adduser --registry {{registryUrl}}",
"second-step": "2. 发布",
@ -83,11 +83,11 @@
},
"installation": {
"title": "安装",
"install-using-yarn": "使用yarn安装",
"install-using-yarn": "使用 yarn 安装",
"install-using-yarn-command": "yarn add {{packageName}}",
"install-using-npm": "使用npm安装",
"install-using-npm": "使用 npm 安装",
"install-using-npm-command": "npm install {{packageName}}",
"install-using-pnpm": "使用pnpm安装",
"install-using-pnpm": "使用 pnpm 安装",
"install-using-pnpm-command": "pnpm install {{packageName}}"
},
"repository": {
@ -97,8 +97,8 @@
"title": "作者"
},
"distribution": {
"title": "最后发布",
"license": "License",
"title": "发布信息",
"license": "许可",
"size": "大小",
"file-count": "文件数量"
},
@ -109,7 +109,7 @@
"title": "贡献者"
},
"engines": {
"npm-version": "NPM Version",
"npm-version": "NPM 版本",
"node-js": "NODE JS"
}
},
@ -132,17 +132,21 @@
"page-not-found": "404 - 页面不存在",
"sorry-we-could-not-find-it": "对不起, 我们没找到..."
},
"app-context-not-correct-used": "The app context was not correct used",
"app-context-not-correct-used": "app context 没有被正确使用",
"theme-context-not-correct-used": "theme context 没有被正确使用",
"package-meta-is-required-at-detail-context": "packageMeta is required at DetailContext"
},
"lng": {
"english": "英語",
"portuguese": "葡萄牙語",
"spanish": "西班牙文",
"german": "德語",
"english": "英语",
"japanese": "日语",
"portuguese": "葡萄牙语",
"spanish": "西班牙语",
"german": "德语",
"chinese": "中文",
"french": "法國人"
"french": "法语",
"ukraine": "乌克兰",
"khmer": "Khmer"
},
"help-to-translate": "幫助翻譯",
"change-language": "改變語言"
}
"help-to-translate": "帮助翻译",
"change-language": "改变语言"
}

View File

@ -1,6 +1,6 @@
{
"name": "@verdaccio/ui-theme",
"version": "1.7.0",
"version": "1.7.1",
"description": "Verdaccio User Interface",
"author": {
"name": "Verdaccio Core Team",
@ -144,7 +144,7 @@
},
{
"path": "./static/main.*.js",
"maxSize": "30 kB"
"maxSize": "35 kB"
},
{
"path": "./static/[0-9].*.{js,css}",

View File

@ -4984,4 +4984,4 @@
"_rev": "61-e6be890a78963127",
"readme": "# jQuery\n\n> jQuery is a fast, small, and feature-rich JavaScript library.\n\nFor information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/).\nFor source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery).\n\nIf upgrading, please see the [blog post for 3.3.1](https://blog.jquery.com/2017/03/20/jquery-3.3.1-now-available/). This includes notable differences from the previous version and a more readable changelog.\n\n## Including jQuery\n\nBelow are some of the most common ways to include jQuery.\n\n### Browser\n\n#### Script tag\n\n```html\n<script src=\"https://code.jquery.com/jquery-3.3.1.min.js\"></script>\n```\n\n#### Babel\n\n[Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively.\n\n```js\nimport $ from \"jquery\";\n```\n\n#### Browserify/Webpack\n\nThere are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...\n\n```js\nvar $ = require(\"jquery\");\n```\n\n#### AMD (Asynchronous Module Definition)\n\nAMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html).\n\n```js\ndefine([\"jquery\"], function($) {\n\n});\n```\n\n### Node\n\nTo include jQuery in [Node](nodejs.org), first install with npm.\n\n```sh\nnpm install jquery\n```\n\nFor jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes.\n\n```js\nrequire(\"jsdom\").env(\"\", function(err, window) {\n\tif (err) {\n\t\tconsole.error(err);\n\t\treturn;\n\t}\n\n\tvar $ = require(\"jquery\")(window);\n});\n```",
"_id": "jquery"
}
}

View File

@ -13,10 +13,10 @@ import Loading from '../components/Loading';
import Box from '../muiComponents/Box';
import StyleBaseline from '../design-tokens/StyleBaseline';
import { Theme } from '../design-tokens/theme';
import loadDayJSLocale from '../design-tokens/load-dayjs-locale';
import AppContextProvider from './AppContextProvider';
import AppRoute, { history } from './AppRoute';
import loadDayJSLocale from './load-dayjs-locale';
const StyledBox = styled(Box)<{ theme?: Theme }>(({ theme }) => ({
backgroundColor: theme?.palette.background.default,

View File

@ -13,6 +13,9 @@ import austria from './img/austria.svg';
import spain from './img/spain.svg';
import usa from './img/usa.svg';
import france from './img/france.svg';
import japan from './img/japan.svg';
import ukraine from './img/ukraine.svg';
import khmer from './img/khmer.svg';
import earth from './img/earth.svg';
import verdaccio from './img/verdaccio.svg';
import filebinary from './img/filebinary.svg';
@ -32,6 +35,9 @@ export interface IconsMap {
france: string;
germany: string;
india: string;
japan: string;
ukraine: string;
khmer: string;
earth: string;
verdaccio: string;
license: string;
@ -60,6 +66,9 @@ export const Icons: IconsMap = {
germany,
usa,
france,
japan,
ukraine,
khmer,
};
export interface Props {

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="japan"><path d="M473.655 88.275H38.345C17.167 88.275 0 105.442 0 126.62v258.76c0 21.177 17.167 38.345 38.345 38.345h435.31c21.177 0 38.345-17.167 38.345-38.345V126.62c0-21.178-17.167-38.345-38.345-38.345z" fill="#f5f5f5"/><circle cx="256" cy="255.999" r="97.1" fill="#ff4b55"/></svg>

After

Width:  |  Height:  |  Size: 350 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="khmer"><g fill="#032ea1"><path d="M0 304.8v64.8a48.3 48.3 0 0048 48.8h400c26.4 0 48-21.6 48-48.8v-64.8H0zM448 77.6H48c-26.4 0-48 21.6-48 48.8v64.8h496v-64.8a48.3 48.3 0 00-48-48.8z"/></g><path fill="#e00025" d="M0 189.6h496v116H0z"/><g fill="#042a7f"><path d="M448 418.4c26.4 0 48-21.6 48-48.8v-64.8H315.2L448 418.4zM448 77.6H48l132.8 113.6H496v-64.8a48.3 48.3 0 00-48-48.8z"/></g><path fill="#b50030" d="M316 306.4h180V189.6H180z"/><path fill="#002566" d="M448 77.6H48l370.4 113.6H496v-64.8a48.3 48.3 0 00-48-48.8z"/><path fill="#8c002b" d="M496 214.4v-24.8h-81.6z"/><path fill="#002566" d="M496 369.6a48.3 48.3 0 01-48 48.8H48c-26.4 0-48-21.6-48-48.8"/><g fill="#fff"><path d="M249.6 200s0-2.4-1.6-2.4-1.6 2.4-1.6 2.4h3.2zM321.6 290.4v-7.2h-24 20v-6.4h-4V272h-16H312v-4h-3.2c-.8-.8-2.4-1.6-2.4-3.2v-12c.8-1.6 1.6-3.2 2.4-3.2v-11.2c-1.6 0-2.4 1.6-2.4 1.6v-4.8h-1.6v9.6-6.4h-2.4 2.4v-1.6h-2.4v-5.6c-.8 0-.8 2.4-2.4 2.4-.8 0-.8-.8 0-1.6s.8-1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 3.2 0 .8.8 1.6.8 3.2 0 .8-.8 1.6-.8 1.6-.8 0-.8-.8-1.6-2.4-.8.8-.8 3.2-.8 3.2 1.6 2.4 2.4 3.2 2.4 4s-.8 1.6-1.6-.8c-.8.8 0 2.4 0 2.4 0 1.6 1.6 1.6 1.6 3.2v3.2h-.8c0-3.2 0-4-.8-4v3.2c0-3.2-3.2-3.2-3.2-3.2v3.2c.8 0 1.6.8 1.6 2.4s-.8 1.6-.8 1.6h-1.6l42.4 36.8H288h-12l31.2 26.4h19.2V292h-4v-8.8h-.8zm-19.2-36v.8-.8zm-3.2.8h4-4zm-12 .8h-4 4zM248 197.6c-1.6 0-1.6 2.4-1.6 2.4h2.4c.8 0 .8-2.4-.8-2.4z"/><path d="M243.2 203.2v2.4h9.6v-2.4zM252 203.2v-1.6h-8v1.6zM250.4 201.6V200h-4.8v1.6z"/></g></svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="ukraine"><path d="M0 248v121.6C0 396.8 21.6 416 48 416h400c26.4 0 48-19.2 48-46.4V248H0z" fill="#fdce0c"/><path d="M248 248l197.6 168c26.4 0 50.4-19.2 50.4-46.4V248H248z" fill="#f4ba00"/><path d="M448 80H48C21.6 80 0 99.2 0 126.4V248h496V126.4c0-27.2-21.6-46.4-48-46.4z" fill="#44c1ef"/><path d="M448 80H48l200 168h248V126.4c0-27.2-21.6-46.4-48-46.4z" fill="#18b4ea"/><path d="M496 368.8c0 29.6-21.6 47.2-48 47.2H48c-26.4 0-48-20.8-48-48" fill="#f2a700"/><path d="M48 80h400c26.4 0 48 19.2 48 46.4V216" fill="#10a2e2"/></svg>

After

Width:  |  Height:  |  Size: 593 B

View File

@ -9,7 +9,6 @@ import Grow from '@material-ui/core/Grow';
import Popper from '@material-ui/core/Popper';
import MenuList from '@material-ui/core/MenuList';
import styled from '@emotion/styled';
import { css } from '@emotion/core';
import { Language } from '../../../i18n/config';
import ThemeContext from '../../design-tokens/ThemeContext';
@ -25,34 +24,58 @@ import Icon from '../Icon';
const VERDACCIO_UI_GITHUB_REPOSITORY = 'https://github.com/verdaccio/ui';
const getTranslatedCurrentLanguage = (
t: TFunction
): { [key: string]: { translation: string; icon: React.ComponentProps<typeof Icon>['name'] } } => ({
'en-us': {
translation: t('lng.english'),
icon: 'usa',
},
'fr-fr': {
translation: t('lng.french'),
icon: 'france',
},
'pt-br': {
translation: t('lng.portuguese'),
icon: 'brazil',
},
'de-de': {
translation: t('lng.german'),
icon: 'germany',
},
'es-es': {
translation: t('lng.spanish'),
icon: 'spain',
},
'zh-cn': {
translation: t('lng.chinese'),
icon: 'china',
},
});
const getTranslatedCurrentLanguageDetails = (
t: TFunction,
currentLanguage: string
): { translation: string; icon: React.ComponentProps<typeof Icon>['name'] } => {
switch (currentLanguage) {
case 'fr-FR':
return {
translation: t('lng.french'),
icon: 'france',
};
case 'pt-BR':
return {
translation: t('lng.portuguese'),
icon: 'brazil',
};
case 'de-DE':
return {
translation: t('lng.german'),
icon: 'germany',
};
case 'es-ES':
return {
translation: t('lng.spanish'),
icon: 'spain',
};
case 'zh-CN':
return {
translation: t('lng.chinese'),
icon: 'china',
};
case 'ja-JP':
return {
translation: t('lng.japanese'),
icon: 'japan',
};
case 'uk-UA':
return {
translation: t('lng.ukraine'),
icon: 'ukraine',
};
case 'km-KH':
return {
translation: t('lng.khmer'),
icon: 'khmer',
};
default:
return {
translation: t('lng.english'),
icon: 'usa',
};
}
};
const LanguageSwitch = () => {
const themeContext = useContext(ThemeContext);
@ -65,9 +88,9 @@ const LanguageSwitch = () => {
}
const languages = (i18next.options.resources ? Object.keys(i18next.options.resources) : []) as Array<Language>;
const currentLanguage: Language = i18next.language || i18next.options?.fallbackLng?.[0];
const currentLanguage = themeContext.language;
const { translation: userLanguage } = getTranslatedCurrentLanguage(t)[currentLanguage.toLowerCase()];
const { translation: userLanguage } = getTranslatedCurrentLanguageDetails(t, currentLanguage);
const handleToggle = useCallback(() => {
setOpen(prevOpen => !prevOpen);
@ -124,7 +147,7 @@ const LanguageSwitch = () => {
{languages
.filter(language => language !== currentLanguage)
.map(language => {
const { icon, translation } = getTranslatedCurrentLanguage(t)[language.toLowerCase()];
const { icon, translation } = getTranslatedCurrentLanguageDetails(t, language);
return (
<StyledMenuItem
key={language}

View File

@ -3,15 +3,14 @@ import { ThemeProvider as MuiThemeProvider } from '@material-ui/core/styles';
import { ThemeProvider as EmotionThemeProvider } from 'emotion-theming';
import i18next from 'i18next';
import { Language } from '../../i18n/config';
import loadDayJSLocale from './load-dayjs-locale';
import ThemeContext from './ThemeContext';
import { getTheme, ThemeMode } from './theme';
import useLocalStorage from './useLocalStorage';
const ThemeProvider: React.FC = ({ children }) => {
const isDarkModeDefault = window?.__VERDACCIO_BASENAME_UI_OPTIONS?.darkMode;
const currentLanguage: Language = i18next.language || i18next.options?.fallbackLng?.[0];
const currentLanguage = i18next.languages?.[0];
const [isDarkMode, setIsDarkMode] = useLocalStorage('darkMode', !!isDarkModeDefault);
const [language, setLanguage] = useLocalStorage('language', currentLanguage);
@ -24,7 +23,8 @@ const ThemeProvider: React.FC = ({ children }) => {
useEffect(() => {
changeLanguage();
}, [language, changeLanguage]);
loadDayJSLocale();
}, [language, changeLanguage, loadDayJSLocale]);
return (
<ThemeContext.Provider value={{ isDarkMode, setIsDarkMode, language, setLanguage }}>

View File

@ -19,12 +19,7 @@ function loadDayJSLocale() {
const fallbackLanguage = getFallFackLanguage();
const locale = i18n.language || fallbackLanguage;
// dayjs loades en-US by default
if (!locale || locale === 'en-US') {
return;
}
switch (locale.toLowerCase()) {
switch (locale?.toLowerCase()) {
case 'pt-br':
{
require('dayjs/locale/pt-br');
@ -61,7 +56,17 @@ function loadDayJSLocale() {
dayjs.locale('ja');
}
break;
case 'uk-ua':
{
require('dayjs/locale/uk');
dayjs.locale('uk');
}
break;
default:
{
require('dayjs/locale/en');
dayjs.locale('en');
}
break;
}
}

View File

@ -1,6 +1,6 @@
import { SyntheticEvent } from 'react';
import { copyToClipBoardUtility } from './cli-utils';
import { copyToClipBoardUtility, getCLISetConfigRegistry } from './cli-utils';
describe('copyToClipBoardUtility', () => {
let originalGetSelection;
@ -47,3 +47,18 @@ describe('copyToClipBoardUtility', () => {
expect(spys.removeChild).toHaveBeenCalledWith(expectedDiv);
});
});
describe('getCLISetRegistry', () => {
const command = 'npm set';
const scope = '@testscope';
const blankScope = '';
const url = 'https://test.local';
test('should return ":" separated string when scope is set', () => {
expect(getCLISetConfigRegistry(command, scope, url)).toEqual(`${command} ${scope}:registry ${url}`);
});
test('should not output scope when scope is not set', () => {
expect(getCLISetConfigRegistry(command, blankScope, url)).toEqual(`${command} registry ${url}`);
});
});

View File

@ -21,7 +21,8 @@ export const copyToClipBoardUtility = (str: string): ((e: SyntheticEvent<HTMLEle
};
export function getCLISetConfigRegistry(command: string, scope: string, registryUrl: string): string {
return `${command} ${scope}registry ${registryUrl}`;
// if there is a scope defined there needs to be a ":" separator between the scope and the registry
return `${command} ${scope}${scope !== '' ? ':' : ''}registry ${registryUrl}`;
}
export function getCLISetRegistry(command: string, registryUrl: string): string {

View File

@ -50,7 +50,7 @@ describe('formatRepository', (): void => {
describe('formatDate', (): void => {
test('should format the date', (): void => {
const date = 1532211072138;
expect(formatDate(date)).toEqual('21.07.2018, 22:11:12');
expect(formatDate(date)).toEqual('07/21/2018 10:11:12 PM');
});
});
@ -78,7 +78,7 @@ describe('formatDateDistance', (): void => {
describe('getLastUpdatedPackageTime', (): void => {
test('should get the last update time', (): void => {
const lastUpdated = packageMeta._uplinks;
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('22.07.2018, 22:11:12');
expect(getLastUpdatedPackageTime(lastUpdated)).toEqual('07/22/2018 10:11:12 PM');
});
test('should get the last update time for blank uplink', (): void => {
@ -91,9 +91,9 @@ describe('getRecentReleases', (): void => {
test('should get the recent releases', (): void => {
const { time } = packageMeta;
const result = [
{ time: '14.12.2017, 15:43:27', version: '2.7.1' },
{ time: '05.12.2017, 23:25:06', version: '2.7.0' },
{ time: '08.11.2017, 22:47:16', version: '2.6.6' },
{ time: '12/14/2017 3:43:27 PM', version: '2.7.1' },
{ time: '12/05/2017 11:25:06 PM', version: '2.7.0' },
{ time: '11/08/2017 10:47:16 PM', version: '2.6.6' },
];
expect(getRecentReleases(time)).toEqual(result);
expect(getRecentReleases()).toEqual([]);

View File

@ -5,12 +5,14 @@ import { UpLinks } from '@verdaccio/types';
import isString from 'lodash/isString';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import { Time } from '../../types/packageMeta';
export const TIMEFORMAT = 'DD.MM.YYYY, HH:mm:ss';
export const TIMEFORMAT = 'L LTS';
dayjs.extend(relativeTime);
dayjs.extend(localizedFormat);
/**
* Formats license field for webui.