You are here

function uc_attribute_translate in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_attribute/uc_attribute.module \uc_attribute_translate()

Translates an attribute.

Parameters

&$attribute: The attribute object to translate.

1 call to uc_attribute_translate()
uc_attribute_load in uc_attribute/uc_attribute.module
Loads an attribute from the database.

File

uc_attribute/uc_attribute.module, line 1558
Ubercart Attribute module.

Code

function uc_attribute_translate(&$attribute) {
  if (function_exists('i18n_string')) {
    $attribute->name = i18n_string('uc_attribute:attribute:' . $attribute->aid . ':name', $attribute->name);
    $attribute->label = i18n_string('uc_attribute:attribute:' . $attribute->aid . ':label', $attribute->label);
    $attribute->description = i18n_string('uc_attribute:attribute:' . $attribute->aid . ':description', $attribute->description);
    foreach ($attribute->options as &$option) {
      $option->name = i18n_string('uc_attribute:option:' . $option->oid . ':name', $option->name);
    }
  }
}