Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set custom language #7

Open
vintage opened this issue Jul 18, 2016 · 3 comments
Open

Can't set custom language #7

vintage opened this issue Jul 18, 2016 · 3 comments

Comments

@vintage
Copy link

vintage commented Jul 18, 2016

I'm unable to change the default language for the tinyMCE editor. The language is set in the Django settings file and it's passed to the tinyMCE editor in the javascript file:

https://github.com/isotoma/wagtailtinymce/blob/master/wagtailtinymce/static/wagtailtinymce/js/tinymce-editor.js#L64

but it's located in nested 'options' key instead of flat structure. I've managed to monkey-patch the code by adding to the:

https://github.com/isotoma/wagtailtinymce/blob/master/wagtailtinymce/rich_text.py#L84

following line:

kwargs.update({ 'language': kwargs['options'].get('language'), 'paste_as_text': True, })

The paste_as_text is used as extra parameter for the constructor as I didn't find any way to pass such value by hooks/settings.

Here are the tineMCE docs about localization:

https://www.tinymce.com/docs/configure/localization/#language

@nfletton
Copy link

Just noticed your issue after posting this PR (#8) a few minutes ago. Same problem addressed.

@Braintelligence
Copy link

Yeah it would be great if this could be fixed 👍

@pacotole
Copy link

You can solve options/language problem in https://github.com/isotoma/wagtailtinymce/blob/master/wagtailtinymce/rich_text.py#L81-L83 replacing:

        kwargs = {
            'options': self.kwargs.get('options', {}),
        }

with:

        kwargs = self.kwargs.get('options', {})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants