pylixm / django-mdeditor

Django-mdeditor is Markdown Editor plugin application for django base on Editor.md.
https://pypi.org/project/django-mdeditor/
GNU General Public License v3.0
481 stars 103 forks source link

Can I add my localization file? #131

Closed uselessvevo closed 2 years ago

uselessvevo commented 3 years ago

I've translated editor's localizaation file to my native, then I've collected static files (manage.py collectstatic), changed MDEDITOR_CONFIGS -> 'language' to 'ru' but editor switched to default chinese language.

What did I do wrong?

uselessvevo commented 3 years ago

Okay, there is the first solution. You need to modify markdown.html in here: https://github.com/pylixm/django-mdeditor/blob/master/mdeditor/templates/markdown.html#L41

Here is the code:

{% block load_js %}
<script src={% static 'mdeditor/languages/'|add:config.language|add:'.js' %}></script>
{% endblock %}

And it will work. But I don't really like how you implemented localization in plugins. Maybe, I will modify it too.

pylixm commented 2 years ago

You can try to submit a PR for your own native, like PR https://github.com/pylixm/django-mdeditor/pull/104

pylixm commented 2 years ago

If there is no reply for a long time, it is temporarily closed and can be reopened if necessary.