如何更改整个Django CMS网站的语言?

时间:2022-01-19 07:22:03

I would like to change the language of a website written with the Django CMS from en-us to de in a way that all present contents in en-us will be shown for de in the future.

我想将用Django CMS编写的网站的语言从en-us更改为de,以便将来在en-us中显示所有当前内容。

I tried

我试过了

Page.objects.all().update(languages='de')

but afterwards there were 404 Errors everywhere.

但之后到处都有404个错误。

What else do I have to change?

我还需要改变什么?

1 个解决方案

#1


1  

To change the language codes for all content on a django CMS site, run these commands (switching from 'en-us' to 'de':

要更改django CMS站点上所有内容的语言代码,请运行以下命令(从'en-us'切换到'de':

Page.objects.filter(language='en-us').update('de')
Title.objects.filter(language='en-us').update(language='de')
CMSPlugin.objects.filter(language='en-us').update(language='de')

#1


1  

To change the language codes for all content on a django CMS site, run these commands (switching from 'en-us' to 'de':

要更改django CMS站点上所有内容的语言代码,请运行以下命令(从'en-us'切换到'de':

Page.objects.filter(language='en-us').update('de')
Title.objects.filter(language='en-us').update(language='de')
CMSPlugin.objects.filter(language='en-us').update(language='de')