Magento 翻译标签
我有一个 magento 安装,效果很好。 到目前为止一切顺利,我已经设置了不同的商店视图来以不同的语言管理商店。 现在,我有以下问题: 我已经从管理部门设置了标签,并将它们分配给不同商店视图中的不同产品(假设我将标签“Buch”分配给德国商店视图中的产品,我将标签“Book”分配给相同的产品)英文商店视图中的产品。 如果用户单击其中一个标签名称,则会显示具有相同标签的产品列表。 但如果他随后更改商店视图,magento 会保留相同的标签,并表示没有带有该标签的产品。 这看起来很合乎逻辑,因为标签(据我所知)是不可翻译的。 我想要magento做的是,如果用户更改产品列表中的商店视图,请使用标签的翻译(比方说,用户看到带有标签“buch”的所有产品并将视图更改为英语,他会看到带有“书”标签的所有产品,或者,如果不可能,则在更改商店视图时,他总是
提前访问商店主页=) 。
i have a magento installation wich works pretty well.
So far so good, i've set up different Store Views to manage the store in different languages.
Now, i have the following problem:
I've set up tags from the administration and assigned them to the different products in the different store views (let's say i assign the tag "Buch" to a Product in the german store view, i assign the tag "Book" to the same product in the english store view.
If then a user clicks on one of the tag-names it shows the list of products with the same tag.
But if he changes store-view then, magento keeps the same tag and says that there are no products with that tag.
This seems quite logically, because tags (as far as i understood) are not translatable.
What i want magento to do, is that if a user changes store-view in the list with the products, use a translation of the tag (lets say, a user sees all the products with the tag "buch" and changes the view to english, he sees all the products with the tag "book", or, if that is not possible, when changing store-view, that he always goes to the store homepage.
Thanks 100000 times in advance =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我看到的唯一解决方案是手动翻译标签。为此,您必须修改模板中所有出现的标签。例如,在
template/tag/cloud.phtml
中替换为
然后将每个标签的翻译添加到
app/design/frontend/[your-interface]/[your-theme]/locale 中/de_DE
或任何其他语言。作为替代解决方案,您可以创建一个自定义模块,该模块将覆盖
$_tag->getName()
函数并在其中添加$this->__()
。The only solution I see is to translate tags manually. To do this you have to modify all occurrences of your tags in your templates. For example in
template/tag/cloud.phtml
replacewith
And then add the translation for each tag into
app/design/frontend/[your-interface]/[your-theme]/locale/de_DE
or any other language.As an alternative solution you can create a custom module which will override
$_tag->getName()
function and add$this->__()
in there.