Please make the following string translatable in uc_coupon.module:
'Enter a coupon code for this order.'

Currently:
variable_get('uc_coupon_pane_description', 'Enter a coupon code for this order.')

This would be better:
t(variable_get('uc_coupon_pane_description', 'Enter a coupon code for this order.'))

Comments

gabor_h’s picture

Priority: Normal » Minor
Status: Active » Closed (won't fix)

Well, actually I have simply set this variable to '' (an empty string).

- this way it is not displayed
- therefore there is no need to translate it
- therefore there is no need to make this string translatable.

pcambra’s picture

Status: Closed (won't fix) » Active

I think that the correct way for doing this should be:

variable_get('uc_coupon_pane_description', t('Enter a coupon code for this order.'));

So it can be translated by interface and allows to have the message in different languages in the store only by translating it. What do you think?

Pls’s picture

Why this is not yet commited ? Seems like natural thing that all strings should be enclosed with t(''). Please consider this for next version.

gabor_h’s picture

Category: feature » bug
Priority: Minor » Normal

Yes, please consider this for next version.

marcus_w’s picture

Correct me if I'm wrong, but since this is a variable, shouldn't one specify multiliguality in the settings.php?
See http://drupal.org/node/313272.

pcambra’s picture

Yes, you can, but I think it would be far from optimal, i.e. for install profiles like my case, altering settings.php to include the lines of variables is not useful, I'd like to have it integrated in the translation, with l10n_update would get translated right away

Romejoe’s picture

1.
Added the variable to the settings.php but can not find where the field for changing it is located. Where do I need to enter the other language now?

2.
I would like this translateable as well.... since this seems a minor problem why don't include in the next UG?

longwave’s picture

Version: 6.x-1.3 » 6.x-1.x-dev
Status: Active » Fixed

In the -dev branch, the i18n variable setting should be configured correctly and this message should be translatable. Please reopen if this is not the case.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

daamy’s picture

thanks

kopeboy’s picture

Issue summary: View changes

3 years and a half have passed and still this is not updated for 7.x- version.

I cannot translate that specific string.
7.x-3.0-alpha0

graham leach’s picture

Hello,

I am also struggling with the multilingual capabilities of uc_coupon. I am working with code extracted from uc_coupon-6.x-1.7.tar.gz. In modules/uc_coupon/uc_coupon.module the following appears at line 998:

      $form['uc_coupon_pane_description'] = array(
        '#type' => 'textarea',
        '#title' => t('Checkout pane message'),
        '#default_value' => variable_get('uc_coupon_pane_description', t('Enter a coupon code for this order.')),
      );

...and the following code at line 949:

 $description = variable_get('uc_coupon_pane_description', t('Enter a coupon code for this order.'));

These are the only places in the code base where the phrase Enter a coupon code for this order. appears.:

# grep "Enter a coupon" * -R
uc_coupon.module:      $description = variable_get('uc_coupon_pane_description', t('Enter a coupon code for this order.'));
uc_coupon.module:        '#default_value' => variable_get('uc_coupon_pane_description', t('Enter a coupon code for this order.')),

Now, the presence of the t function bounding the phrase led me to believe that the phrase was/is translatable, but it is apparently not, which makes me wonder whether configuring the system to treat it as a multilingual variable would be the way to go.

I have seen this before, where the t function was being ignored - specifically, when dealing with the Submit Order button on the checkout screen. That story (with screen caps) can be seen at:

http://mymanthemaker.blogspot.hk/2017/03/solved-ubercarts-quirky-treatme...

At the moment, my guess is that PHP needs to be informed that this variable is multilingual. I will be documenting whether or not that is true here:

http://mymanthemaker.blogspot.hk/2017/03/drupal-ubercart-translating-un....

[SOLVED]

OK, this is a multilingual variable that is capable of being translated once it can be found.

1. Go to the appropriate place in the Drupal system:

Home » Dashboard » Store administration » Configuration » Checkout settings » Coupon discount settings

2. Enter the anchor language message you want (or leave what is there alone)

3. Switch language context (click on language icon or prepend language code to url path in browser)

Original URL Example: 
http://holisticpethelp.com/admin/store/settings/checkout/edit/panes

Prepended URL Example: 
http://holisticpethelp.com/zh/admin/store/settings/checkout/edit/panes

4. Enter translation and click on Save

[SOLVED]