如何从Django管理站点管理系统语言?

2024-04-26 17:21:01 发布

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

有没有什么方法可以从django管理界面启用/禁用或添加/删除系统语言?因为Django says

"It reads metadata in your model to provide a powerful and production-ready interface that content producers can immediately use to start adding content to the site."

django book tells us

"This is a Web-based interface, limited to trusted site administrators, that enables the adding, editing and deletion of site content."

我认为主要的一点是管理内容网站的力量。那么,如果我的语言设置启用了站点中某些语言的内容,为什么django不允许我修改它?(向站点添加/删除语言)。在

我想要这样的东西:

enter image description here


Tags: andthetodjango方法语言内容界面
1条回答
网友
1楼 · 发布于 2024-04-26 17:21:01

你的意思是翻译管理界面本身吗?如果是这样,this可能会有所帮助。您希望在DB的admin/i18n中有翻译文件吗?我不认为Django不是这样工作的,它使用.po/.mo文件。在

internationalization documentation非常好,可能在刚开始时有点太大而无法理解,但是Django有几个开关来控制您想要的。在

一个很好的地方来理解使用什么开关来满足您的需要(至少我发现它非常有趣)是其中的implementation notes段,以及{a4}这段给出了逻辑的HLD。在

抱歉,如果我的回答与主题不符,但作为劳拉,我觉得我不完全理解你的问题。在

相关问题 更多 >