I could not find a way to translate Coupon type label in checkout. Here is a patch that wrapps coupon type labels with a t(). Don't know if this it the correct way to do this but it works.

Comments

pcambra’s picture

Status: Needs review » Needs work

That's not how a label is translated, I'm afraid, you need to use i18n_field module for this.

killua99’s picture

FileSize
649 bytes

Also I have an issue with the hook_commerce_price_component_type_info the $name of the label is unstranslated. This is the same issue with the i18n_field?

killua99’s picture

Issue summary: View changes

Added more explenation

RiBu-Nezz’s picture

Hi I have the same problem, my coupon type name/label doesn't be translated even I use i18n_field module. When the coupon line item is added at the checkout page, the coupon type name is still be in English. How can I change it to my language? Any advice will be appreciated!

Cristian.Andrei’s picture

Issue summary: View changes
FileSize
795 bytes

Here'a patch based on killua99's solution with an added context. Works just fine.

Cristian.Andrei’s picture

Status: Needs work » Needs review

changed status

pcambra’s picture

Status: Needs review » Needs work

As I said in #1, using t() for variables is not the right solution, i18n_fields and i18n_strings should be used instead

killua99’s picture

Surprisingly I couldn't never put it work with i18n_fields and i18n_strings, maybe some miss configuration.

Thanks Cristian.Andrei I'm gonna update my patch url in my make file.

killua99’s picture

Status: Needs work » Reviewed & tested by the community

This patch work just great, none issue with the $variables use in t function.

It's clear some never get work the i18n_field correctly so, this solution just works.

pcambra’s picture

Status: Reviewed & tested by the community » Needs work

Please don't RTBC this, as I've mentioned in the above comments, t() shouldn't not be used for variables like this, the solution is using the other suggested methods.