In this file uc_userpoints_payment.module, this line of code (123) has a translation issue :


t('!Points (Total available via !points: ' . uc_currency_format($maxdisc) . ')', userpoints_translation())

is resulting in a non localizable string as uc_currency_format($maxdisc) is a variable.
It should be something like : (this is working for me)


// As it's using userpoints_translation() to pop the t() variables replacement array
// I push a new value to this final array.
$userpoints_translation_array = userpoints_translation();
$userpoints_translation_array['!maxdisc'] = uc_currency_format($maxdisc);

// And then call the array instead of the function.
 'title'	=> t('!Points (Total available via !points: !maxdisc)', $userpoints_translation_array),

Thx for solving this.
Best regards

Comments

bmagistro’s picture

Status: Active » Closed (fixed)

I am marking this closed, but don't know which commit resolved this. Code for that is now around line 162 and looks like this. Looking at past issues and code looks like this was first resolved here: http://drupal.org/node/698884. Not sure if there are other ones related.

    $title = t('!Points', uc_userpoints_translation());
    if (variable_get(USERPOINTS_PAY_DISPLAY, 1)) {
      // Display point amounts
      if (variable_get(USERPOINTS_DISPLAY, 2) == 1) {
        // Display currency instead of points
        $amount = uc_currency_format($amount / variable_get(USERPOINTS_UC_PAYMENT, 1));
      }   
      $title .= ' '. t('(total available: !amount)', array('!amount' => $amount));
    }