diff --git a/uc_order/uc_order.i18n.inc b/uc_order/uc_order.i18n.inc new file mode 100644 index 0000000..12c69fb --- /dev/null +++ b/uc_order/uc_order.i18n.inc @@ -0,0 +1,32 @@ + t('Ubercart order status'), + 'description' => t('Translatable Ubercart order statuses'), + 'format' => FALSE, + 'list' => TRUE, + ); + return $groups; +} + +/** + * Refreshes translated order statuses. + */ +function uc_order_i18n_string_refresh() { + $statuses = db_query("SELECT order_status_id, title FROM {uc_order_statuses}"); + foreach ($statuses as $status) { + i18n_string_update('uc_order_status:status:' . $status->order_status_id . ':title', $status->title); + } + + return TRUE; +} diff --git a/uc_order/uc_order.module b/uc_order/uc_order.module index 0523c8d..84806dd 100644 --- a/uc_order/uc_order.module +++ b/uc_order/uc_order.module @@ -1877,6 +1877,11 @@ function uc_order_status_list($scope = 'all', $sql = FALSE, $action = '') { while ($status = $result->fetchAssoc()) { $status['id'] = $status['order_status_id']; unset($status['order_status_id']); + + if (function_exists('i18n_string')) { + $status['title'] = i18n_string('uc_order_status:status:' . $status['id'] . ':title', $status['title']); + } + $statuses[$scope][] = $status; } usort($statuses[$scope], 'uc_weight_sort');