是否可以翻译自定义内容类型的视图路径/标题?

发布于 2024-12-23 17:10:08 字数 152 浏览 1 评论 0原文

我是 Drupal 的新手。

我安装了带有 i18n 模块的 Drupal。

一切都很完美,但我遇到了一个问题。

我创建了自定义内容类型和一个显示它的视图。现在我有一个问题...是否有可能翻译视图路径/标题?

问候, 戴夫·W

I'm a newcomer to Drupal.

I have a Drupal installation with i18n module.

Everything works perfectly however I faced one issue.

I created custom content type and a view to display it. Now I have a quesiton... Is there any possibility to translate view path/title?

Regards,
DaveW

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

忆依然 2024-12-30 17:10:08

对于所有开始 Drupal 冒险的人来说都是一个众所周知的问题。

如何解决问题?这非常非常简单。我假设您已创建并启用了语言 - 我将使用英语作为默认语言。

  1. 使用请求的标题和路径创建视图。我总是使用英语作为第一语言,即。消息。
  2. 转到管理 » 配置 » 搜索和元数据 » URL 别名 并通过单击添加新别名 链接创建新别名(如果此模块已禁用,您需要启用它)。
  3. 从下拉菜单中,选择您的第二(或第三等)语言,在我的例子中是波兰语。
  4. 现有系统路径字段中提供您创建的视图的英文路径:在我们的例子中,它是news
  5. 路径别名字段中提供您的翻译,即。 wiadomosci 波兰语。

瞧。现在,当波兰语是当前语言时,它将使用别名 wiadomosci 作为 news 路径。

注意:刚刚在最新的 Drupal 安装上进行了测试 - 工作完美。

Well known issue for all people starting their adventure with Drupal.

How to solve the problem? It's very, very simple. I presume you have your languages created and enabled - I'll use English as default language.

  1. Create your view with requested title and path. I always use English language as the first language, ie. news.
  2. Go to Administration » Configuration » Search and metadata » URL aliases and create new alias by clicking Add new alias link (if this module is disable you need to enable it).
  3. From dropdown menu, select your second (or third etc.) language, in my case Polish.
  4. In Existing system path field provide the English path of the view you created: in our case it's news.
  5. In Path alias field provide your translation, ie. wiadomosci for Polish language.

Voila. Now, when Polish is the current language, it will use an alias wiadomosci for news path.

Note: Just tested on fresh latest Drupal installation - works perfectly.

雪化雨蝶 2024-12-30 17:10:08

如果您看这里:

http://reyero.net/en/drupal/drupal7_i18n_beta1_overview (这是模块作者的页面)

他显示了用于启用分类术语翻译的选项,这将是到达实际页面的路径 - 例如作为您为内容设置的类别。

还有一个节点复选框,这将是您的内容。人们可能会认为这会翻译 url 或节点内容。

他的网站似乎没有将网址翻译成西班牙语,而只是更改了菜单项。 URL 回退到节点号,而不是之前显示的别名。

也许这有帮助,或者这对你来说已经很明显了,但我会尝试使用这些选项。

很好的概述 - http://evolvingweb.ca/story/drupal-7 -多语言-whats-new-i18n

路径翻译

Drupal 7 路径翻译模块允许您创建翻译
为路径设置。路径转换用于通用路径(例如
例如,对于视图页面),而不是对于节点或分类页面路径。你
可以通过转到配置»区域来配置多语言路径
和语言 » 翻译集 » 路径。

似乎暗示有一种方法可以翻译节点 - 不确定是否必须硬编码或者是否会自动发生 - 不过看起来很有希望。

本指南可能也会有所帮助:http://drupal.org/node/133977

If you take a look here:

http://reyero.net/en/drupal/drupal7_i18n_beta1_overview (This is the module author's page)

He shows options for enabling translation of taxonomy terms, which would be the path up to your actual page - such as categories you've set up for your content.

There is also a tickbox for node, which would be your content. One would think that this would translate the either the url or the node content.

His site doesn't seem to translate to the url to spanish, but just changes menu items. The URL falls back to the node number instead of the alias which was previously displayed.

Maybe this helps or maybe this is already obvious to you, but I would tray playing with those options.

Nice overview - http://evolvingweb.ca/story/drupal-7-multilingual-whats-new-i18n

Path Translation

The Drupal 7 Path Translation Module allows you to create translation
sets for paths. Path translations are used for generic paths (for
example, for views pages), not for node or taxonomy page paths. You
can configure multilingual paths by going to Configuration » Regional
and language » Translation sets » Paths.

Seems to imply that there is a way to translate the nodes - not sure if you have to hard code or if it will happen automatically - looks promising though.

This guide might be helpful as well: http://drupal.org/node/133977

紫罗兰の梦幻 2024-12-30 17:10:08

最简单的方法似乎是使用国际化视图模块:https://drupal.org/project/i18nviews

The easiest way seems to be to go with the Internationalisation Views module: https://drupal.org/project/i18nviews.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文