Translation
The plugin uses TinyMCE’s own I18n. Set the standard language option and the plugin follows it:
tinymce.init({ language: 'de', language_url: '/tinymce/langs/de.js', … });
language_url is TinyMCE’s language pack for its own UI (download it from tiny.cloud); the plugin’s texts are handled by the plugin.
| Code | Language | |
|---|---|---|
en |
English | built in |
cs |
Čeština | built in |
sk |
Slovenčina | language file |
de |
Deutsch | language file |
es |
Español | language file |
fr |
Français | language file |
pt_BR |
Português (Brasil) | language file |
it |
Italiano | language file |
pl |
Polski | language file |
Translations other than English and Czech are machine translations reviewed twice; corrections are welcome at dev@coolsoft.cz.
Language files
English and Czech are inside the plugin. The other languages are separate files in plugins/bootstrapui/langs/ next to the plugin, so the plugin stays small (each page loads only its own language). When the plugin sits in tinymce/plugins/bootstrapui/ or is loaded through external_plugins, TinyMCE loads the right file by itself. Keep the langs folder next to plugin.min.js and set language.
With a bundler (the ES module plugin.esm.js), import the language you need after TinyMCE:
import 'tinymce';
import registerBootstrapUi from 'tinymce-bootstrapui';
import 'tinymce-bootstrapui/langs/de.js';
registerBootstrapUi(tinymce);
The same files are available on the Downloads page. Use them to add a newer translation without replacing the whole plugin.
Adding another language
The easiest way is the template bootstrapui.template.js (Downloads page or langs/ in the package): it contains all plugin strings in English. Replace xx with your language code and translate the values, then load the file like a language file above. Untranslated strings stay in English.
You can also register a dictionary directly.
Every user-visible string is looked up by its English text. Register your dictionary before tinymce.init:
tinymce.addI18n('de', {
'Insert {0}': '{0} einfügen',
'Card': 'Karte',
'Card title': 'Kartentitel',
'Appearance': 'Darstellung',
// …
});
Component names are used as keys (Card, Modal, Navs and tabs) and the dialog title is composed with Insert {0} / Edit {0}. Strings you do not translate stay English.