Compare commits

...

10 Commits

16 changed files with 207 additions and 13 deletions

View File

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

View File

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

View File

@ -144,7 +144,8 @@
"german": "Deutsch", "german": "Deutsch",
"chinese": "Chinesisch", "chinese": "Chinesisch",
"french": "Französisch", "french": "Französisch",
"ukraine": "Ukrainisch" "ukraine": "Ukrainisch",
"khmer": "Khmer"
}, },
"help-to-translate": "Hilfe beim Übersetzen", "help-to-translate": "Hilfe beim Übersetzen",
"change-language": "Sprache ändern" "change-language": "Sprache ändern"

View File

@ -144,7 +144,8 @@
"german": "German", "german": "German",
"chinese": "Chinese", "chinese": "Chinese",
"french": "French", "french": "French",
"ukraine": "Ukraine" "ukraine": "Ukraine",
"khmer": "Khmer"
}, },
"help-to-translate": "Help to translate", "help-to-translate": "Help to translate",
"change-language": "Change language" "change-language": "Change language"

View File

@ -144,7 +144,8 @@
"german": "Alemán", "german": "Alemán",
"chinese": "Chino", "chinese": "Chino",
"french": "Francés", "french": "Francés",
"ukraine": "Ucraniano" "ukraine": "Ucraniano",
"khmer": "Khmer"
}, },
"help-to-translate": "Ayuda a traducir", "help-to-translate": "Ayuda a traducir",
"change-language": "Cambiar idioma" "change-language": "Cambiar idioma"

View File

@ -144,7 +144,8 @@
"german": "Allemand", "german": "Allemand",
"chinese": "Chinois", "chinese": "Chinois",
"french": "Français", "french": "Français",
"ukraine": "Ukrainien" "ukraine": "Ukrainien",
"khmer": "Khmer"
}, },
"help-to-translate": "Aide à la traduction", "help-to-translate": "Aide à la traduction",
"change-language": "Changer la langue" "change-language": "Changer la langue"

View File

@ -144,7 +144,8 @@
"german": "ドイツ語", "german": "ドイツ語",
"chinese": "中国語", "chinese": "中国語",
"french": "フランス語", "french": "フランス語",
"ukraine": "ウクライナ" "ukraine": "ウクライナ",
"khmer": "Khmer"
}, },
"help-to-translate": "翻訳を助ける", "help-to-translate": "翻訳を助ける",
"change-language": "言語を変更" "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

@ -144,7 +144,8 @@
"german": "Alemão", "german": "Alemão",
"chinese": "Chinês", "chinese": "Chinês",
"french": "Francês", "french": "Francês",
"ukraine": "Ucraniano" "ukraine": "Ucraniano",
"khmer": "Khmer"
}, },
"help-to-translate": "Ajude a traduzir", "help-to-translate": "Ajude a traduzir",
"change-language": "Mudar idioma" "change-language": "Mudar idioma"

View File

@ -144,7 +144,8 @@
"german": "Німецька", "german": "Німецька",
"chinese": "Китайська", "chinese": "Китайська",
"french": "Французька", "french": "Французька",
"ukraine": "Українська" "ukraine": "Українська",
"khmer": "Khmer"
}, },
"help-to-translate": "Допоможіть перекласти", "help-to-translate": "Допоможіть перекласти",
"change-language": "Змінити мову" "change-language": "Змінити мову"

View File

@ -143,7 +143,8 @@
"german": "德语", "german": "德语",
"chinese": "中文", "chinese": "中文",
"french": "法语", "french": "法语",
"ukraine": "烏克蘭" "ukraine": "烏克蘭",
"khmer": "Khmer"
}, },
"help-to-translate": "幫助翻译", "help-to-translate": "幫助翻译",
"change-language": "改变语言" "change-language": "改变语言"

View File

@ -15,6 +15,7 @@ import usa from './img/usa.svg';
import france from './img/france.svg'; import france from './img/france.svg';
import japan from './img/japan.svg'; import japan from './img/japan.svg';
import ukraine from './img/ukraine.svg'; import ukraine from './img/ukraine.svg';
import khmer from './img/khmer.svg';
import earth from './img/earth.svg'; import earth from './img/earth.svg';
import verdaccio from './img/verdaccio.svg'; import verdaccio from './img/verdaccio.svg';
import filebinary from './img/filebinary.svg'; import filebinary from './img/filebinary.svg';
@ -36,6 +37,7 @@ export interface IconsMap {
india: string; india: string;
japan: string; japan: string;
ukraine: string; ukraine: string;
khmer: string;
earth: string; earth: string;
verdaccio: string; verdaccio: string;
license: string; license: string;
@ -66,6 +68,7 @@ export const Icons: IconsMap = {
france, france,
japan, japan,
ukraine, ukraine,
khmer,
}; };
export interface Props { export interface Props {

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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0-.8.8-.8 1.6 0 1.6.8.8.8 1.6 0 2.4-.8 0-.8 0-1.6-1.6 0 0-.8 1.6-.8 2.4 0 .8 1.6 3.2 0 3.2-.8 0-.8-.8-.8-2.4-.8.8-.8 1.6-.8 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

@ -64,6 +64,11 @@ const getTranslatedCurrentLanguageDetails = (
translation: t('lng.ukraine'), translation: t('lng.ukraine'),
icon: 'ukraine', icon: 'ukraine',
}; };
case 'km-KH':
return {
translation: t('lng.khmer'),
icon: 'khmer',
};
default: default:
return { return {
translation: t('lng.english'), translation: t('lng.english'),

View File

@ -1,6 +1,6 @@
import { SyntheticEvent } from 'react'; import { SyntheticEvent } from 'react';
import { copyToClipBoardUtility } from './cli-utils'; import { copyToClipBoardUtility, getCLISetConfigRegistry } from './cli-utils';
describe('copyToClipBoardUtility', () => { describe('copyToClipBoardUtility', () => {
let originalGetSelection; let originalGetSelection;
@ -47,3 +47,18 @@ describe('copyToClipBoardUtility', () => {
expect(spys.removeChild).toHaveBeenCalledWith(expectedDiv); 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 { 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 { export function getCLISetRegistry(command: string, registryUrl: string): string {