You are here

function i18nprofile_form_translate_category in Internationalization 6

Translate form fields for a given category.

2 calls to i18nprofile_form_translate_category()
i18nprofile_form_alter in i18nprofile/i18nprofile.module
Implementation of hook_form_alter().
i18nprofile_form_translate_all in i18nprofile/i18nprofile.module
Translate form fields for all categories.

File

i18nprofile/i18nprofile.module, line 177
Internationalization (i18n) submodule: Profile translation.

Code

function i18nprofile_form_translate_category(&$form, $category) {
  if (!empty($form[$category])) {
    $form[$category]['#title'] = i18nstrings('profile:category', $form[$category]['#title']);
    foreach (element_children($form[$category]) as $field) {
      i18nprofile_form_translate_field($form[$category], $field);
    }
  }
}