0.7.0 • Published 5 years ago

inst-tinymce-locales v0.7.0

Weekly downloads
30
License
MIT
Repository
github
Last release
5 years ago

inst-tinymce-locales

npm

Exposes a fetchTranslations function that takes a language code (required) and custom language code mappings (optional), and returns an object with translations (if translations for that language are supported) or undefined (if translations for that language are not supported). Returned translation objects will have two keys: languageCode and content. languageCode refers to the TinyMCE language code for the translations, and content contains all translations.

const { fetchTranslations } = require('inst-tinymce-locales')
fetchTranslations('ru') // returns a translations object
fetchTranslations('myCustomLanguage') // returns undefined
fetchTranslations('myCustomLanguage', { myCustomLanguage: 'ru' }) // returns a translations object

Once translations are fetched, one will typically want to load them in their tinymce instance:

translations = fetchTranslations('de')
tinymce.addI18n(translations.languageCode, translations.content)
0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago