lang function
The lang function returns a specific message in the current language. This function is part of the idsadmin class, which provides a library of basic functions for plug-ins for the HCL OpenAdmin Tool (OAT) for Informix®.
Syntax
lang($item, $parameters=array())
Variable | Purpose | Restrictions |
---|---|---|
item | The name of the text string to be returned in the current language. | |
parameters | The parameters in an array. The parameters are substituted for "{0}", "{1}", "{2}", and so on. | Optional. |
Usage
The lang function finds the specified message in the loaded language files. If the current language is not English and the specified message cannot be found, then the message is returned in English. If it is not available in English, an error is returned.
Examples
This example retrieves the text for the item taskdetailssaved in the current language and prints it as a status message.
$this->idsadmin->status($this->idsadmin->lang("taskdetailssaved"));
The item is contained in the language file for the module as shown in this example in English.
<taskdetailssaved><![CDATA[Task details saved successfully.]]></taskdetailssaved>
This example sets the browser page title for the OAT.
page in$this->idsadmin->html->set_pagetitle($this->idsadmin->lang("alerts") );
Here is the item in the language file for the module from the language file in English and in Spanish.
<alerts><![CDATA[Alerts]]></alerts>
<alerts><![CDATA[Alertas]]></alerts>