将“布局字符串”翻译为“布局字符串”。在 Drupal 6 中
我正在 Drupal 6 中开发一个网站,该网站将被翻译成 10 多个习语。对于主要内容,我使用 CCK + i18n。但网站布局中有一些文本我不确定如何翻译。
例如,假设这是一个销售软件的网站。在列出所有可用软件(Drupal 节点)的页面中,侧边栏中有一些文本显示“查看最畅销的程序!”。据我所知,这段文本可能是:
- 在一个块中(好)
- 直接在该页面的模板中(坏)
这两个选项都将使用 t() 函数 翻译文本。问题在于 t() 使用字符串作为键来创建原始字符串与其翻译之间的关联。例如,如果我将文本翻译成 10 种不同的语言,明天我决定对英文文本进行一些小更改,我将需要再次创建所有翻译。
第三种选择是为这种类型的字符串设置自定义内容类型,在这种情况下,将进行翻译,创建节点的翻译版本 (i18n)。然而,这似乎工作量太大,而且不是完成它的正确方法。
Drupal 或某些社区模块是否提供了更好的方法来翻译这些字符串?
谢谢。
I'm developing a site in Drupal 6 that will be translated to over 10 idioms. For the main content, I'm using CCK + i18n. But there are some text in the site's layout that I'm not sure how to translate.
For example, let's suppose that it's a site that sells software. In the page that lists all available software (which are Drupal nodes), I have some text in the sidebar that says "Check out the best selling programs!". From what I know, this text could be:
- In a block (good)
- Directly in the template for this page (bad)
Both of these options would use the t() function to translate the text. The problem is that t() uses the string as the key to create the association between the original string and its translations. If, for example, I translate the text to 10 different languages and tomorrow I decide to make a small change to the english text, I'll need to create all the translations again.
A third option would be to have a custom Content Type for this type of string, and in this case the translation would be made creating a translated version of the node (i18n). However, this seems too much work and not the right way to accomplish it.
Does Drupal or some community module provides a better way to translated these strings?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我没记错的话,最新版本的 i18n 模块应该支持翻译块内容和标题。另请参阅http://drupal-translation.com/content/translated-block-contents。
If I'm not mistaken, the latest version of the i18n module should support translating block content and titles. See also http://drupal-translation.com/content/translating-block-contents.