带视图的多语言 drupal 网站
我正在尝试用 Drupal 制作一个多语言网站。我需要的语言是德语、荷兰语、英语和法语。我添加了 i18n 模块并添加了语言。
我使用视图在网站上显示我的内容。目前我有一页想要翻译成 4 种语言。我为每个翻译创建了一个视图。现在我想将我的视图链接到正确的节点。因此,我在内容节点中使用视图字段。
问题: 我的问题出在网址上。第一次一切都很好。 我的网址: localhost/?q=nl/activiteiten
现在,当我在语言栏中选择英语时,语言会更改,但网址不会更改。我的网址:localhost/?q=en/activiteiten
这里的“activiteiten”必须是“activities”。我该如何解决这个问题?
我在 drupal 论坛上搜索了这个问题一段时间,但似乎找不到解决这个问题的好方法。我发现的唯一的事情是使用内容节点中的视图字段或节点主体中的 input_views 。这两个对我来说不起作用。
I'm trying to make a multilingual website in Drupal. My languages that I need are german, dutch, english and french. I've added the i18n module and added the languages.
I work with views to show my content on the website. For the moment I have one page that I want to translate in the 4 languages. I've created a view for each translation. Now I want to link my view to the correct node. Therefore I use a view field in my content node.
PROBLEM:
My problem lies in the url. The first time everything is fine.
my url: localhost/?q=nl/activiteiten
Now when I select english in my language bar the language changes but not the url. my url: localhost/?q=en/activiteiten
Here "activiteiten" must be "activities". How do I solve this?
I've searched a while for this problem on the drupal forums but I can't seem to find a good solution to this problem. The only thing I've found is working with a view field in the content node or with input_views in the body of your node. These two won't work for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
i18 模块无需为每个模块创建视图
语言,你必须使用 i18 翻译内容,然后
改变语言之间收费。
你可能从一开始就没有使用该模块就有问题
声明的所有语言,您必须编辑每种语言
内容并保存以更好地关联它。
i18 module with no need to create a view for each
language, you have to translate content using the i18, then
charge between changing the language.
You can have problems from the beginning did not use the module
all languages declared, you have to edit each
content and save it to associate it well.
好吧,只是阅读您自己的答案,我认为您在某个地方转错了方向(或者您正在尝试做其他事情,而我不太明白)。
要为页面创建多语言视图(这就是我认为您想要做的),您首先要创建一个页面视图(废话),指定您想要显示的内容并定义它的路径。然后启用(如果尚未启用)URL 别名(“URL-aliassen”)模块并为每种语言定义别名(即 FR : activites - 我不喜欢 URL 中的重音符号 :p - NL : activiteiten, DE : aktivitaten - 如果我没记错的话,再次删除重音符号:p)。从那时起,这些别名将用作路径。
有关描述此过程的文章,请参阅:翻译 Drupal 中的视图路径。
顺便说一句,您当然也可以使用 Pathauto 模块 根据节点的标题创建这些别名,而不是手动定义它们,您甚至可以在更改设置时批量(重新)创建它们。
Well, just reading your own answer I think you've taken a wrong turn somewhere (or you're trying to do something else and I didn't quite catch on).
To create multilingual views for pages (which is what I think you want to do) you would first create a page view (duh), specify what you want to be shown and define a path to it. Then you enable (if it's not enabled already) the URL-alias ("URL-aliassen") module and define aliases for each language (ie. FR : activites - I don't like accents in URLs :p - NL : activiteiten, DE : aktivitaten - if memory serves me right anyway, again with accents removed :p). These aliases will be used as the path from that moment on.
For an article describing this process refer to : Translating Views paths in Drupal.
BTW You could also use the Pathauto module to create these aliases based on the title of your nodes of course instead of defining them manually, you can even (re)create them in batch when you alter the settings.
最终我用视野解决了我的问题。我已经创建了我的视图,并在我的节点中选择了列表中的该视图。然后,您可以在正文中输入该语言的内容。
Eventually I've solved my problem with a view field. I've made my view and in my node I've selected that view in the list. Then in the body you can type something for that language.