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®.


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.


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.


This example retrieves the text for the item taskdetailssaved in the current language and prints it as a status message.


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 Health Center > Alerts page in OAT.

$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.


Copyright© 2018 HCL Technologies Limited