Hello, guys!

'Percentage coupon' label on checkout page into components section couldn't be translated.

Is it critical if we change 15 line in commerce_coupon_pct.install ?

  $values = array(
    'type' => 'commerce_coupon_pct',
-   'label' => st('Percentage coupon'),
+  'label' => t('Percentage coupon'),
  );

Comments

bradjones1’s picture

st() is actually a function, and it appears it might be appropriate here since this code could run during installation. See http://api.drupal.org/api/drupal/includes!install.inc/function/st/7

sja1’s picture

See next comment

sja1’s picture

Category: Task » Bug report
Issue summary: View changes

If this code can be run both during installation and at other times, the api documentation states that the correct function to use is "get_t".

See: https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/get_t/7

sja1’s picture

To change the text from "Percentage discount" to something else, you can go to admin/commerce/coupons/types, click "edit" for the "Percentage discount" type, and change its name there. This will modify the text that shows up in the order component summary on the checkout pages.

It doesn't solve the translation problem though, your modified text will be displayed for all languages.