Form API: Form field not being translated I'm implementing a gender field in a custom registration form.

The gender field also exists as a user field, so I'd like to call the label and allowed values from the existing instance. I've written it as a conditional override just in case...:

$form['gender'] = array(
    '#title' =&gt; t('Gender'),
    '#type' =&gt; 'radios',
    '#options' =&gt; array('female' =&gt; t('Female'), 'male' =&gt; t('Male')),
    '#required' =&gt; TRUE,
);
if($field = field_info_field('field_gender')) {
    $form['gender']['#options'] = $field['settings']['allowed_values'];
    $info = field_info_instance('user', 'field_gender', 'user');
    $form['gender']['#title'] = t($info['label']);   
}


Everything's working great, except for the multilingual part: despite having translated the field instance at the admin account settings using i18n, the extracted options and title of the existing field are not being translated upon changing the front-end language. They DO get translated however when visiting the user account page in a different language.

It seems my custom form doesn't send its strings through i18n...?

Can anyone point me out the pitfall please?

Thanks

UPDATE  

I used

$func = function($val) { return t($val); };
$form['gender']['#options'] = array_map($func, $field['settings']['allowed_values']);


as suggested by Shameem to translate the options.  But now it seems t() is fetching translations from the Locale module repository. How to direct t() to fetch it from i18n?
the field options are not going through the t function. 

you would need to take each value from the following array and make it go through the t() function

$field['settings']['allowed_values'];

and please check that $info['label'] is a plain text and not an array.