I need to create dropdown list for all languages in my Drupal form, Is there any function in PHP to achieve this. I want to create an array of all languages and pass it to drupal form.
function video_upload_subtitles_form($form, &$form_state) {
$form = array('#attributes' => array('enctype' => 'multipart/form-data'));
$lang_list = array();//**how to create this array**
$form['video_name'] = array(
'#title' => t('Name Of the video'),
'#type' => 'textfield',
);
$form['sub_file'] = array(
'#type' => 'file',
'#title' => t('Upload video'),
'#description' => t('Pick a video file to upload.'),
);
$form['user_list']=array(
'#type'=>'select',
'#title' => t('Language'),
'#options' => $lang_list,//array of language
'#multiple' => false,
'#attributes'=>array('size'=>4),
'#weight'=>8,
);
$form['submit_button'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
return $form;
}
I know listing of language can be done in php by listing and making a array manually but is it possible to do with any php function, just looking for some easy way to save time.
Got this cool website for Country List . Is there anything for the Language like this