You are here

function i18nprofile_form_translate_all in Internationalization 5.3

Same name and namespace in other branches
  1. 5 i18nprofile/i18nprofile.module \i18nprofile_form_translate_all()
  2. 5.2 i18nprofile/i18nprofile.module \i18nprofile_form_translate_all()
  3. 6 i18nprofile/i18nprofile.module \i18nprofile_form_translate_all()

Translate form fields for all categories

This is useful when we don't know which categories we have, like in the user register form

1 call to i18nprofile_form_translate_all()
i18nprofile_form_alter in i18nprofile/i18nprofile.module
Implementation of hook_form_alter()

File

i18nprofile/i18nprofile.module, line 170

Code

function i18nprofile_form_translate_all($form_id, &$form) {
  $categories = profile_categories();
  if (is_array($categories)) {
    foreach ($categories as $category) {
      if (isset($form[$category['name']])) {
        i18nprofile_form_translate($form_id, $form, $category['name']);
      }
    }
  }
}