Anyone know how I can translate a discount Short Description (@short_description) for a multilingual website?

I tried through the Translation interface but can't find any strings to translate.

Comments

tinker’s picture

I have a feeling this is due to the Discount title not being passed through t() before display.

 // uc_discounts.module
function add_discount_line_items_to_order(&$order, $discounts) {
  //Create line items for discounts and store in order's uc_discounts_line_items field
  $line_items = array();
  foreach ($discounts as $discount) {
    $line_item = array(
      'type' => LINE_ITEM_KEY_NAME,
      // 'title' => $discount->short_description, ORG WITH NO T()
      'title' => t($discount->short_description),
      'amount' => -$discount->amount,
      'weight' => LINE_ITEM_WEIGHT,
      'data' => array('discount_id' => $discount->discount_id),
    );

    $line_items[] = $line_item;
  }
  $order->uc_discounts_line_items = $line_items;
}

Not tested. Just a suggestion. This should make the string visible to i18n.