Bitrix Site Manager

CLanguage::Add

mixed
CLanguage::Add(
 array fields
)

The method Add adds a new language. Returns the ID of the added language. In case of an error the method will return false, and the LAST_ERROR property will contain the error description.

Parameters

ParameterDescription
fields An array of the field values in the form of array("field"=>"value" [, ...]).

See Also

Example



<?
$arFields = Array(
  "LID"              => "en",
  "ACTIVE"           => "Y",
  "SORT"             => 100,
  "DEF"              => "N",
  "NAME"             => "English",
  "FORMAT_DATE"      => "MM/DD/YYYY",
  "FORMAT_DATETIME"  => "MM/DD/YYYY HH:MI:SS",
  "CHARSET"          => "iso-8859-1"
  );
$obLang = new CLanguage;
$obLang->Add($arFields);
if (strlen($obLang->LAST_ERROR)>0) $strError .= $obLang->LAST_ERROR;
?>