switchLanguage 不使用 LinguaPlone 加载翻译项目
我仍在努力让 LinguaPlone 正常工作。
我使用 /@@language-setup-folders
设置了两个语言根文件夹 /de
(德语)和 /en
。我创建了两个文件夹,/de/texte/
和 /en/articles
并将后者定义为前者的翻译。
在 ZMI 的 portal_languages
中,我设置了:
- 允许的语言:英语、德语
- 协商方案:[x] 使用 cookie 进行手动覆盖
- 所有其他选项均未选中
我确实得到了呈现的语言选择器,但是当我单击在“English”上,调用 /de/texte/switchLanguage?set_language=en
,我得到英语 UI,但位置仍然是 /de/texte
。
即使面包屑显示 You are here: Home › texte,Home 实际上仍然指向 /de
而不是 /en< /代码>。
我在网上搜索过,但除了一些 LinguaPlone 上的较早咆哮 我找不到我可能丢失的内容。
如何配置 LinguaPlone 在切换语言时实际加载链接翻译?
编辑:
- Plone 4.0.2
- Zope 2.12.13
- LinguaPlone 4.0
I am still struggling getting LinguaPlone to work.
I have set up two language root folders /de
(for German) and /en
using /@@language-setup-folders
. I've created two folders, /de/texte/
and /en/articles
and defined the latter as translation of the former.
In portal_languages
in the ZMI I have set:
- Allowed languages: English, German
- Negotiation Scheme: [x] Use cookie for manual override
- all other options are unchecked
I do get a language selector rendered, but when I click on "English", which calls /de/texte/switchLanguage?set_language=en
, I get an English UI, but the location is still /de/texte
.
And even though the breadcrumbs say You are here: Home › texte, Home actually still points to /de
instead of /en
.
I've searched the web, but apart from some older rant on LinguaPlone I could not find what I've been possibly missing.
How do I configure LinguaPlone to actually load the linked translation when switching languages?
Edit:
- Plone 4.0.2
- Zope 2.12.13
- LinguaPlone 4.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
出现此行为的原因是 LinguaPlone 4.0 与 Plone 4.0.2 上的“Plone 经典主题”不兼容。
切换到“Sunburst Theme”解决了这个问题:语言选择器链接随后指向正确的 URI。
The reason for this behaviour is that LinguaPlone 4.0 is not compatible with the "Plone Classic Theme" on Plone 4.0.2.
Switching to the "Sunburst Theme" solves the problem: the language selector links point to the correct URIs then.
您确实有错误的语言选择器。关于此情况的报道不断出现,但到目前为止,没有人知道它发生的原因和方式。通过为 ILinguaPloneProductLayer 层定义正确的语言选择器来覆盖 Plone 默认选择器。一旦您将“LinguaPlone”皮肤文件夹作为皮肤层的一部分,该浏览器层就应该处于活动状态。
您可以尝试通过转到“http:///portal_skins/manage_propertiesForm”并将 LinguaPlone 移动到顶部“custom”之后,对主题中的皮肤层重新排序。
如果您有自己的主题并定义了任何额外的浏览器层,这些也可能会产生干扰,但很难说清楚具体是什么方式。
You have indeed the wrong language selector. There have been recurring reports about this but so far nobody found out why and how it happens. The correct language selector overrides the Plone default one by being defined for the ILinguaPloneProductLayer layer. This browser layer should be active as soon as you have the "LinguaPlone" skins folder as part of your skin layers.
You could try to reorder the skin layers in your theme by going to "http:///portal_skins/manage_propertiesForm" and moving LinguaPlone to the top, right after "custom".
If you have a theme of your own and defined any extra browser layers, those could possibly interfere as well, but it's hard to tell in what exact ways.
我认为您的语言选择器有误。
Plone 附带了一个基本的语言选择器视图(plone/app/i18n/locales/browser/configure.zcml 中的“plone.app.i18n.locales.languageselector”)。它只是切换 Plone 界面的语言(而不是内容)。这是链接到“switchLanguage”的语言选择器。
当您安装 LinguaPlone 时,它会用它自己的语言选择器覆盖 Plone 语言选择器。
LP 选择器不应链接到“switchLanguage”,而是链接到目标语言的内容项的 URL(使用 ?set_language 参数)。
此视图在 Products/LinguaPlone/browser/configure.zcml 中定义,
也许 LP 未正确安装,或者某些内容覆盖了视图?
I think you have the wrong language selector.
There is a basic language selector viewlet that is shipped with Plone ("plone.app.i18n.locales.languageselector" in plone/app/i18n/locales/browser/configure.zcml). It just switches the language of the Plone interface (not the content). This is the language selector that links to "switchLanguage".
When you install LinguaPlone, it overrides the Plone language selector with it's own.
The LP selector is not supposed to link to "switchLanguage", but the URL of the content item in the target language (with the ?set_language parameter).
This viewlet is defined in Products/LinguaPlone/browser/configure.zcml
Perhaps LP is not correctly installed, or something is overriding the viewlet ?