From ad551c18823127d290511c5a732161258dc7c7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Sat, 16 May 2020 08:18:02 +0300 Subject: [PATCH 1/2] fix(translation): useless warning about unsupported current language (#174) --- src/i18n/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i18n/index.ts b/src/i18n/index.ts index a214025..bcc9960 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -46,9 +46,9 @@ export function getMsg (path: string, args?, lang: null | string = null): string let currentLang = lang || getCurrentLang() if (!dictionary[currentLang]) { - currentLang = defaultLanguage - ConsoleLogger.warn(`The current language "${currentLang}" is not yet available. Using language "${defaultLanguage}" by default. Contribution to github is welcome.`) + + currentLang = defaultLanguage } const dictionaryByLang = dictionary[currentLang] From 2cf77ff58fa65ddc0605275ae5c63ab0569a88a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Sat, 16 May 2020 08:20:47 +0300 Subject: [PATCH 2/2] feat(i18n): cs translation (#173) --- README.md | 2 +- demo/main.js | 2 +- src/i18n/cs/index.ts | 146 +++++++++++++++++++++++++++++++++++++++++++ src/i18n/index.ts | 4 +- 4 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 src/i18n/cs/index.ts diff --git a/README.md b/README.md index a9e821c..2520d50 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ If you have Vuetify `1.x` (not `2.x`), then you can find docs and demo [here](ht - used vuetify components - support for different types of icons ([fa](https://fontawesome.com/), [md](https://material.io/tools/icons/), [mdi](https://materialdesignicons.com/), [mdiSvg](https://vuetifyjs.com/en/customization/icons#install-material-design-icons-js-svg)) -- internationalization (en, es, fr, pl, ru, uk, ptbr, tr, he, nl, ja, de, ko, zh-CN, fa, sv), with automatic detection of the current language through the Vuetify. You can make a PR for your language if it is not there, [here](https://github.com/iliyaZelenko/tiptap-vuetify/pull/118/files) is an example. +- internationalization (en, es, fr, pl, ru, uk, ptbr, tr, he, nl, ja, de, ko, zh-CN, fa, sv, cs), with automatic detection of the current language through the Vuetify. You can make a PR for your language if it is not there, [here](https://github.com/iliyaZelenko/tiptap-vuetify/pull/118/files) is an example. - markdown support - easy to start using - props and events are available diff --git a/demo/main.js b/demo/main.js index 9691fba..d99fb3a 100644 --- a/demo/main.js +++ b/demo/main.js @@ -20,7 +20,7 @@ import { MAIN_MODULE } from './config' const vuetify = new Vuetify({ lang: { - current: 'en' // en | es | fr | pl | ru | uk | ptbr | tr | he | nl | ja | de | ko | zh-CN | fa | sv + current: 'en' // en | es | fr | pl | ru | uk | ptbr | tr | he | nl | ja | de | ko | zh-CN | fa | sv | cs } }) diff --git a/src/i18n/cs/index.ts b/src/i18n/cs/index.ts new file mode 100644 index 0000000..17d9d8e --- /dev/null +++ b/src/i18n/cs/index.ts @@ -0,0 +1,146 @@ +export default { + extensions: { + Blockquote: { + buttons: { + blockquote: { + tooltip: 'Bloková citace' + } + } + }, + Bold: { + buttons: { + bold: { + tooltip: 'Tučně' + } + } + }, + BulletList: { + buttons: { + bulletList: { + tooltip: 'Bodový seznam' + } + } + }, + Code: { + buttons: { + code: { + tooltip: 'Kód' + } + } + }, + CodeBlock: { + buttons: { + codeBlock: { + tooltip: 'Blok kódu' + } + } + }, + History: { + buttons: { + undo: { + tooltip: 'Zpět' + }, + redo: { + tooltip: 'Vpřed' + } + } + }, + HorizontalRule: { + buttons: { + horizontalRule: { + tooltip: 'Horizontální oddělovač' + } + } + }, + Italic: { + buttons: { + italic: { + tooltip: 'Kurzíva' + } + } + }, + OrderedList: { + buttons: { + orderedList: { + tooltip: 'Číslovaný seznam' + } + } + }, + Paragraph: { + buttons: { + paragraph: { + tooltip: 'Odstavec' + } + } + }, + Strike: { + buttons: { + strike: { + tooltip: 'Přeškrtnutě' + } + } + }, + Underline: { + buttons: { + underline: { + tooltip: 'Podrženě' + } + } + }, + Heading: { + buttons: { + heading: { + tooltip: ({ level }) => level + '. úroveň nadpisu' + } + } + }, + Link: { + buttons: { + isActive: { + tooltip: 'Změnit odkaz' + }, + notActive: { + tooltip: 'Přidat odkaz' + } + }, + window: { + title: 'Správa odkazu', + form: { + hrefLabel: 'Odkaz' + }, + buttons: { + close: 'Zavřít', + remove: 'Odebrat', + apply: 'Použít' + } + } + }, + Image: { + buttons: { + tooltip: 'Obrázek' + }, + window: { + title: 'Přidat obrázek', + form: { + sourceLink: 'Adresa obrázku', + altText: 'Alternativní text', + addImage: 'Přidat obrázek' + }, + imageUpload: { + instruction: 'Vyberte soubor(y) nebo je(j) přetáhněte sem.' + }, + buttons: { + close: 'Zavřít', + apply: 'Použít' + } + } + }, + TodoList: { + buttons: { + todoList: { + tooltip: 'Seznam TODO' + } + } + } + } +} diff --git a/src/i18n/index.ts b/src/i18n/index.ts index bcc9960..7e135aa 100644 --- a/src/i18n/index.ts +++ b/src/i18n/index.ts @@ -14,6 +14,7 @@ import ko from './ko' import zh from './zh' import fa from './fa' import sv from './sv' +import cs from './cs' import ConsoleLogger from '~/logging/ConsoleLogger' import { TiptapVuetifyPlugin } from '~/main' @@ -35,7 +36,8 @@ export const dictionary = { ko, zh, fa, - sv + sv, + cs } export function getCurrentLang () {