简体   繁体   English

Magento:将新产品添加到我的购物车后,翻译不起作用

[英]Magento: translations don't work after adding a new product to my cart

First of all, I am not great at Magento. 首先,我在Magento方面并不出色。 I think I understand all of the basics and maybe a bit more, but I couldn't create a module from scratch for example. 我想我了解所有基础知识,甚至可能更多,但是例如,我无法从头开始创建模块。

Anyway, I am trying to create an e-commerce website in french, but I can't seem to make the translations work. 无论如何,我试图用法语创建一个电子商务网站,但是我似乎无法使翻译工作。

My issue is the following: 我的问题如下:

The french translation seem to be working fine, until I add a product to the cart. 在我将产品添加到购物车之前,法语翻译似乎运行良好。

Once I have done that, the "X product has been added to your cart" shows in english and then the "See my cart" and some other lines go back to english even though they were in french the second before, and I don't know why. 完成此操作后,“ X产品已添加到您的购物车”将以英文显示,然后显示“查看我的购物车”和其他一些行,即使它们之前是法语,也返回英文。不知道为什么。

I have tried to add other translation packs but it doesn't seem to change anything. 我尝试添加其他翻译包,但似乎没有任何改变。

I suppose it's an issue with the english translation that take priority over the french translation for some reason, but I don't know where to look to solver this issue. 我想这是英文翻译的问题,由于某种原因它优先于法语翻译,但是我不知道该去哪里解决。

My magento version: 1.9.3 - Community edition 我的magento版本: 1.9.3-社区版

The theme I'm using: Sebian for magento 我正在使用的主题: Sebian for magento

Thank you for your time :) 感谢您的时间 :)

Please follow the below step. 请按照以下步骤操作。

  1. Create a file if not exists. 创建文件(如果不存在)。 app/design/{package}/{theme}/locale/fr_FR/translate.csv app / design / {package} / {theme} /locale/fr_FR/translate.csv
  2. Add this to translate.csv file >> "%s product has been added to your cart","%s YOUR TRANSLATED LINE" 将此添加到translation.csv文件>>“%s产品已添加到您的购物车”,“%s YOUR TRANSLATED LINE”
  3. Refresh cache from magento and check in frontend 从magento刷新缓存并检入前端
  4. But make sure your Sentence must be written in this way 但是请确保您的句子必须以这种方式编写

    $this->__("YOUR SENTENCE") in phtml file. phtml文件中的$ this- > __(“ YENT SENTENCE”)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM