Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
iliyaZelenko committed May 16, 2020
2 parents 9f35c7a + 2cf77ff commit 41c87f0
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})

Expand Down
146 changes: 146 additions & 0 deletions src/i18n/cs/index.ts
Original file line number Diff line number Diff line change
@@ -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'
}
}
}
}
}
8 changes: 5 additions & 3 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -35,7 +36,8 @@ export const dictionary = {
ko,
zh,
fa,
sv
sv,
cs
}

export function getCurrentLang () {
Expand All @@ -46,9 +48,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]
Expand Down

0 comments on commit 41c87f0

Please sign in to comment.