[eluser]abmcr[/eluser]
Actually, in the view i get my field text in the language as
Code:
echo $data["field_$lang"];
where $lang is a variable with the "eng", "ita" or....
This system work fine, but a problem uncoutered if the field contains the text.... but if the field is empty (this occurs if only the default language is translate) a null string is displayed; i want to do this function
Code:
function check_language($string,$data,$lang,$language_default="ita"){
//this function check if a string of the field in a language($lang) is not null; if is null get in the $data variable the string in the main language and return it
return ($string==""?$data["$string_$language_default"]:$data["$string_$lang"]);
}
but this is most complex.... I want to simplify.... but i am confused... Any tip? Thank you! Ciao