$result=db_query("SELECT lid FROM {locales_source}");
while($string=db_fetch_object($result)){
db_query("INSERT INTO {locales_target} (lid, locale, translation) VALUES (%d,'%s', '')",$string->lid,$code);
db_query("INSERT INTO {locales_target} (lid, language, translation) VALUES (%d,'%s', '')",$string->lid,$code);
}
// If only the language was added, and not a PO file import triggered
// the language addition, we need to inform the user on how to start
// a translation
if($onlylanguage){
drupal_set_message(t('The language %locale has been created and can now be used to import a translation. More information is available in the <a href="@locale-help">help screen</a>.',array('%locale'=>t($name),'@locale-help'=>url('admin/help/locale'))));
// working with the language.
if($verbose){
drupal_set_message(t('The language %language has been created and can now be used. More information is available on the <a href="@locale-help">help screen</a>.',array('%language'=>t($name),'@locale-help'=>url('admin/help/locale'))));
}
else{
drupal_set_message(t('The language %locale has been created.',array('%locale'=>t($name))));
drupal_set_message(t('The language %language has been created.',array('%language'=>t($name))));
}
watchdog('locale',t('The %language language (%locale) has been created.',array('%language'=>$name,'%locale'=>$code)));
watchdog('locale',t('The %language language (%code) has been created.',array('%language'=>t($name),'%code'=>$code)));
}
/**
* User interface for the language management screen.
*/
function_locale_admin_manage_screen(){
$languages=locale_supported_languages(TRUE,TRUE);
$languages=language_list('language',TRUE);
$options=array();
$form['name']=array('#tree'=>TRUE);
foreach($languages['name']as$key=>$lang){
$options[$key]='';
$status=db_fetch_object(db_query("SELECT isdefault, enabled FROM {locales_meta} WHERE locale = '%s'",$key));
'#description'=>t('Commonly this is an <a href="@iso-codes">ISO 639 language code</a> with an optional country code for regional variants. Examples include "en", "en-US" and "zh-cn".',array('@iso-codes'=>'http://www.w3.org/WAI/ER/IG/ert/iso639.htm')),