Contributions API

i18nprofile_categories

Definition

i18nprofile_categories($getraw = FALSE)
contributions/i18n/i18nprofile/i18nprofile.module, line 230

Description

Returns translated categories

@ TODO Drupal 6

Note: weight must be minor than profile module's for them to be added first

Parameters

$getraw Return the raw array of translations

Code

<?php
function i18nprofile_categories($getraw = FALSE) {
  $language = i18n_get_lang();
  if ($translation = variable_get('i18nprofile_'.$language, 0)) {
    if($getraw) {
      return $translation;
    }
    foreach($translation as $name => $value) {
      $categories[] = array('name' => $name, 'title' => $value, 'weight' => 2);
    }
    return $categories;
  } else {
    return array();
  }
}
?>