voidlabs / mosaico

Mosaico - Responsive Email Template Editor
https://mosaico.io
GNU General Public License v3.0
1.71k stars 504 forks source link

Multilanguage support in wysiwygs.js #341

Closed andriyaucar closed 7 years ago

andriyaucar commented 7 years ago

Hello,

I use a custom list button in TinyMCE editor. Custom list is dynamic. I want to translate list element when language is changed. I did it in wysiwygs.js. Can I use viewModel.t for this case in wysiwygs.js?

var menuData = [];
for(var i=0; i < customList.length; i++){
    customList[i].text = viewModel.t(customList[i].value);
    menuData.push(customList[i]);
}
editor.addButton('customButton', {
    type: 'menubutton',
    title: 'Custom Button',
    text: 'Custom Button',
    classes: 'my-style',
    menu: menuData
});
bago commented 7 years ago

Tinymce translations are handled by tinymce itself. Have a look at tinymce and make it work "outside" mosaico, first, as it doesn't depend on mosaico.

andriyaucar commented 7 years ago

Yes, it was solved by uploading TinyMCE language files. Thank you.