Closed demetrius-mp closed 2 years ago
Why don't use the CKEDITOR_LANGUAGE
config to set the UI language?
i didnt know of that option
but still, i tried setting it like
CKEDITOR_LANGUAGE = 'pt'
but it didnt work, is there anything else im missing?
i initialize the extension using the factory pattern, as follows:
from flask_ckeditor import CKEditor
ckeditor = CKEditor()
def init_app(app):
ckeditor.init_app(app)
i am using it as a flask admin field, as follows:
...
from flask_ckeditor import CKEditorField
...
class PostView(BaseView):
create_template = 'create_post.html'
edit_template = 'edit_post.html'
column_list = ('title', 'description', 'guide', 'tags', 'owner', 'published_by',)
form_overrides = {
'content': CKEditorField
}
...
and i render it on the templates like this:
{% extends 'admin/model/edit.html' %}
{% block tail %}
{{ super() }}
{{ ckeditor.load() }}
{% endblock %}
i tried with other language codes, like 'es' and 'de' and it also didnt work
How do you set the config?
You should set it after the app
instance is created, like this:
app.config['CKEDITOR_LANGUAGE'] = 'pt'
Output:
How do you set the config?
i use dynaconf, its how i set all of my other flask configurations
You should set it after the
app
instance is created, like this:app.config['CKEDITOR_LANGUAGE'] = 'pt'
Output:
i tried it like this:
from flask_ckeditor import CKEditor
ckeditor = CKEditor()
def init_app(app):
app.config['CKEDITOR_LANGUAGE'] = 'pt'
ckeditor.init_app(app)
and it still didnt work :/
could you please send the code you used to make it work like the image you sent? maybe im missing something else
GOT IT! https://github.com/greyli/flask-ckeditor/blob/33439ff44d5d3fc25c1776ccaed6edf616c16028/examples/flask-admin/templates/edit.html#L11 i was missing this line thank you so much for replying this fast!
im developing a software that will be used with a non english language, so it would be great to translate the labels of the editor