多语言 Drupal 站点上可能存在的陷阱?
我即将踏上构建多语言 Drupal 站点的旅程,在那里我很可能必须大量使用视图、面板和分类法。我有点担心每种语言的新节点方法,尤其是使用面板。
到目前为止,我已经让它的工作方式与我想要的类似,因为没有对面板内容类型的多语言支持,并从 当前语言和语言中性
获取内容。这似乎按预期工作,但我发现它存在一些问题。有时我可能需要有一个特定语言的小组(例如,不以英语发布)。如果我需要让所有面板都支持多种语言,那么似乎需要做很多工作才能以每种语言为每个页面的每个列放置节点。我想我可以通过使用带有参数的某种视图来获取内容来解决这个问题,但这很可能也会导致大量的工作。
是否有某种正确的方法来完成我试图描述的事情,或者我是否有很多看似不必要的工作需要等待?
I'm about to embark on a journey to build a multilingual Drupal site, where I will most likely have to use Views, Panels and Taxonomy pretty heaily. I am a bit worried about the new-node-for-every-language approach, especially using Panels.
So far I've gotten it to work similarly to what I want by not having multilingual support for the Panels content-type, and fetching content that is from Current language and language neutral
. This seem to work as expected, but I'm seeing some problems with it. There might be the occasion that I will have to have a language specific Panel (not published in English for example). If I need to have all my Panels multilingual, there seems to be alot of work to place the nodes for every column in every page in every language. I'm thinking I could possibly solve this by fetching the content with some kind of view with arguments, but this will most likely also lead to alot of work.
Is there some proper way of doing what I'm attempting to describe, or do I have alot of seemingly unnecessary work to expect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您有 i18n 模块 (http://drupal.org/project/i18n) 和 Views 模块安装。然后,您可以为每种语言创建一个视图 - 可以在视图定义的“过滤器”部分中选择语言。
一旦有了视图,您就可以将它们链接到菜单或块。问题是您必须为每种语言拥有单独版本的块或菜单,并关联正确的视图 - Drupal 根据配置(通常是在浏览器中设置的内容类型)选择正确的语言版本本身。我还没有找到任何更简单的方法来做到这一点。
幸运的是,由于启用 i18n 模块后节点的“transalte”功能,准备多语言内容并不那么困难,因此每个页面的新节点都是可以接受的。
顺便说一句,你是对的,Drupal 进行 i18n 的方式并不是人们能想到的最好的解决方案。有时我很难接受它。
I assume you have i18n module (http://drupal.org/project/i18n) and Views module installed. Then you can create a view for each language - one can choose language in "Filter" section of the view definition.
Once you have views, then you can link them to menus or blocks. The problem is you must have a separate version of block or menu for every language, with a proper view associated - Drupal is choosing proper language version itself according to the configuration (typically content type set in a browser). I haven't found any easier way of doing that.
Fortunately preparing multilingual content is not that hard thanks to the "transalte" functionality for nodes after enabling i18n module, so new node for every page is something one can live with.
BTW you are right that the way Drupal is doing i18n is not the best solution one can think of. I am having hard time with it sometimes.
关于翻译分类术语或词汇名称的观点存在一些严重的问题。这可以通过视图字段中的一些额外模块或/和自定义 PHP 代码来解决。通常70%的模块不支持翻译,那么你需要打补丁来支持它。虽然其他人确实有翻译的可能性,但可能有两种可能的方式:使用变量表来保存与 UI 相关的不同翻译(需要切换到其他语言才能找到字符串)或使用翻译字段表来利用管理菜单中的“翻译界面” 。
到目前为止就是这样:)
祝你好运!
Well there are some serious issues with views over translating taxonomy terms or vocabs names. This could be resolved with some extra modules or / and custom PHP code inside views fields. Usually 70% of modules does not support translation, then you need to patch them to support it. While others does have translation possibility, but it could be two possible ways: uses variables table to hold different translations UI dependent (need to switch to other language to find a string) or uses translation field tables to utilize "translation interface" from admin menu.
So far that's it :)
I wish you luck!