Export to GitHub

django-tinymce - issue #95

incorrect proccessing content_language param in TinyMCE widget


Posted on Feb 18, 2011 by Quick Hippo

What steps will reproduce the problem? 0. install russian (or any other) language pack for tinymce 1. Set LANGUAGE_CODE in django settings.py to "en-us" 2. In django settings.py set TINYMCE_DEFAULT_CONFIG = {'language': "ru", 'theme': "simple", 'relative_urls': False} 3. Or pass content_language parameter into TinyMCE widget constructor

What is the expected output? What do you see instead? getting russian translation in tinymce and TinyMCE's language config option is set to 'ru'. Excatly what i mean: tinyMCE.init({ ... "language": "ru" ... })

What version of Django are you using? On what operating system? 1.2.5

What version of django-tinymce are you using? 1.5

Please provide any additional information below. I think the source of issue in incorrect logic of TinyMCE widget defined in widets.py.

You do following:

def get_language_config(content_language=None): language = get_language()[:2] if content_language: content_language = content_language[:2] else: content_language = language

config = {}
config['language'] = language

The issue can be solved by changing -> config['language'] = language to -> config['language'] = content_language.

I prepared a patch and attached to the issue.

Attachments

Comment #1

Posted on Feb 15, 2012 by Happy Kangaroo

django-tinymce development (code and issues) moved to github. this issue was moved to github. https://github.com/aljosa/django-tinymce/issues/29

Status: WontFix

Labels:
Type-Defect Priority-Medium