Django CMS 3.5.2内部化-翻译模板文本

时间:2018-08-11 03:35:43

标签: django internationalization django-cms

关于Django CMS 3.5.2翻译,我有几个问题。

1)我的网站使用三种语言。我想将模板文本翻译成所有三种语言。我尝试使用{% trans 'my text' %}标签,但是,当我编写python manage.py makemessages -l all命令时,终端显示以下错误消息,而不是创建.po文件:

    RuntimeWarning,
Traceback (most recent call last):
  File "manage.py", line 7, in <module>
    startup.manage(path=os.path.dirname(os.path.abspath(__file__)))
  File "/usr/local/lib/python2.7/site-packages/aldryn_django/startup.py", line 12, in manage
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    commands = get_commands()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 107, in get_commands
    apps = settings.INSTALLED_APPS
  File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 54, in __getattr__
    self._setup(name)
  File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 49, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 132, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'settings' (Is it on sys.path? Is there an import error in the settings file?): No module named deconstruct

我只是想知道是否还有另一种在Django CMS中翻译文本的方法。

2)有没有一种方法可以为非开发人员添加翻译文本的选项? 类似于以下内容(但不仅限于页面名称): enter image description here 谢谢!

0 个答案:

没有答案