drupal 语言切换器不知道别名?切换到node/XX/而不是LANG/text
我的语言切换器有一个大问题, 我有一个多语言网站,每篇文章都有英语和西班牙语版本,默认西班牙语版本 所以如果一篇文章被命名为: domain.com/mi-articulo 那么英文版将是domain.com/en/my-article(使用自动路径创建这些别名) 现在,如果我手动更改网址,效果很好..但如果我使用语言切换器..英语核心,它的切换没有别名和语言前缀 因此,它不是domain.com/en/my-article,而是找到domain.com/node/47,因此当我翻译了菜单和其他内容时,它使drupal不知道语言已切换。 这是屏幕截图,可以更好地了解发生的情况(奇怪的行为) 版本1。西班牙语 版本2。英语 现在,如果我点击英语..看看会发生什么(参见像 drupal 这样的 url 和内容,不知道该内容既不是西班牙语也不是英语...因为语言切换器找不到别名)
I have a big problem with the language switcher,
I have a multi language site that has every article in english and spanish , spanish being the default
so if one article is named :
domain.com/mi-articulo then the english one will be domain.com/en/my-article (using autopath is creating these aliases)
now this works fine if I manualy change the url.. but if I use the language switcher ..the english corespondent it's switches without aliases and Lang prefix
so instead of domain.com/en/my-article it finds domain.com/node/47 so as I have the menu and other things translated it makes drupal unaware of the language switched..
here are the screenshots to better understand what's happening (wierd behaviour)
ver1. spanish
ver2. english
now if i click on english ..look what happends (see url and content like drupal is not aware that this content is nor spanish nor english...because the language switcher doesn't find the aliases)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,直到我设置默认“语言域”
在
admin/settings/language/edit/en
中。现在该模块正在按预期工作。I had the same problem until I set the default 'Language domain'
in
admin/settings/language/edit/en
. Now the module is working as expected.我今天偶然发现了同样的问题。
所有节点都是从另一个站点导入的。所有翻译均已导入,但未导入它们之间的关系,因此,如果您编辑节点并检查翻译,您可能会注意到您的节点没有任何给定的翻译。
如果这是您的问题,您可以使用该功能添加现有节点作为翻译。
I stumbled upon the same issue today.
All nodes had been imported from another site. All translations were imported, but not the relationship between them, so if you edit a node and check the translations, you may notice that your node doesn't have any given translation.
If this is your issue, you may use the functionality to add existing nodes as translations.
我的语言切换器也有同样的问题;只是无法让它做它应该做的事情。我最终通过添加一个块并插入以下 html 来有效地编写了一个非常简单的版本:
它的局限性在于,它总是在切换后带您返回主页,但一旦完成,到其他节点的链接将继续正确地使用 <网址中的代码>/fr。
I have the same problem with the language switcher; just cannot get it to do what it's supposed to do. I ended up effectively writing a very simple version of it by adding a block and inserting the following html:
It is limited in that it always takes you back to the homepage after a switch but once that's done, links to other nodes continue correctly with
/fr
in the url.