1 reply [Last post]
netslave's picture
Offline
Joined: 05/22/2008
Juice: 187
Was this information Helpful?

Here a patch to make error messages in checkout form translatable

function uc_textfield($title, $default = NULL, $required = TRUE, $description = NULL, $maxlength = 32, $size = 32) {
  if (is_null($title) || empty($title))
    return NULL;

  $textfield = array(
    '#type' => 'textfield',
    '#title' => t($title), // call title with t function
    '#description' => $description,
    '#size' => $size,
    '#maxlength' => $maxlength,
    '#required' => $required,
    '#default_value' => $default
  );

  return $textfield;
}

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Make ubercart translatable

That's actually a misuse of the t() function since it's only supposed to be used on literal strings, not variables. We need to do something about this, though. Maybe allow admins to pick one of a choice of different labels.