Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

text-plugin WYMEditor zh-cn.js 404 not found #1288

Closed
losingle opened this Issue · 2 comments

3 participants

@losingle

rquest is /static/cms/wymeditor/lang/zh-cn.js,should be /static/cms/wymeditor/lang/zh_cn.js
django.utils.translation.trans_real.get_language() return zh-cn.js

@richardbarran

I'm getting a similar issue:

  • very plain installation, just one language (MultilingualURLMiddleware is not installed).
  • using default setting LANGUAGE_CODE = 'en-us'
  • text editor uses WYMEditor.

Whenever I open up a text plugin, I see a 404 for file /static/cms/wymeditor/lang/en-us.js.

What's happening is that the Django default language is a combined language + country code, e.g. 'en-us'. This is used in cms/plugins/text/widgets/wymeditor_widget.py (line 45) to feed a language code to the template cms/plugins/widgets/wymeditor.html which then inits a wymeditor instance.

This wymeditor then tries to fetch a translation for en-us (file en-us.js), but the wymeditor has only a 'en' translation, not a 'en-us' or 'en-gb'.

Wymeditor's translations do not map well onto Django's. E.g. Django can use en-us or en-gb, wymeditor only has en. Django has pt and pt-br, and in this case wymeditor also has pt and pt-br.

A fix would be to map in wymeditor_widget.py the languages that could be used in a Django installation, to the languages available in wymeditor. It's ugly, and not easy to maintain, so if someone can suggest a better solution...

@FinalAngel FinalAngel was assigned
@FinalAngel
Owner

wymeditor has been removed in 3.0 and will be available using a separate plugin

@FinalAngel FinalAngel closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.