C编辑器语言出错“用户语言”

2024-10-02 02:32:58 发布

您现在位置:Python中文网/ 问答频道 /正文

http://docs.ckeditor.com/#!/api/CKEDITOR.config

正如上面的API文档所说,如果language为空,则ckeditor将显示默认语言所具有的语言。但我的申请表显示英语。在

我的代码:

 CKEDITOR_CONFIGS = {
'default': {
    'toolbar': 'Custom',
    'toolbar_Custom': [
      [ 'Bold', 'Italic', 'Underline', 'Strike' ],
      [ 'NumberedList', 'BulletedList', '-',  'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
      [ 'Table', 'HorizontalRule', 'Smiley'],
      [  'Format', 'Font', 'FontSize' ],
      [ 'TextColor', 'BGColor' ],
    ],
    'width' : '100%',
    'defaultLanguage' : 'ko',
    'language' : '',
}

}

我该怎么办?在


Tags: 文档comapi语言configckeditorhttpdocs
1条回答
网友
1楼 · 发布于 2024-10-02 02:32:58

Django-CKEDITOR实际上通过使用设置.py的语言设置。您需要确保启用以下所有设置:

# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'en'

LANGUAGES = [
    ('ko', _('Korean')),
    ('en', _('English')),
]

USE_I18N = True

MIDDLEWARE_CLASSES = [
   ...
   'django.middleware.locale.LocaleMiddleware',
]

相关问题 更多 >

    热门问题