Selectbox that change dependig of what language you use?

Hi,

I trying to do translate my selectboxes in the form (by resours language tag) and were the data is stored in my SQL database. But no luck.

The table info in the SQL is.

Table: Categoy
Fields: id, Name, reference_name

Example

id= 500
Name= Car
Reference_name= {tbl_lang_car}

When i do a lookup for a form where i have the select box i would like to use the reference name.

But when i use my reference name i got {tbl_lang_car} in the select box,

I would like the translated language that is in the language module.

Does anybody knows how to work around this problem.

When you do a manual lookup you need to hardcode the categorys and that is not what i want.

Any outthere how have a soulution for this.

Am happy to get the all help i can get , please

Best regards

Hi Sala this is something I had for another app I built and needed something similiar, hope it helps you figure this out… in this case I wanted to change the content displaye din page depending on the user lanaguage either selected on login or from the user profile which I had also stored in db.

sc_apl_conf(‘sec_form_add_users’, ‘start’, ‘new’);

// Get User language on drop menu
$usr_lang = sc_get_language();
$page = ‘login_page’;

//Get page data from DB
$get_content = “SELECT page_title, page_content”
. " FROM pages"
. " WHERE page_actual = ‘" . $page . "’ AND page_lang = ‘" . $usr_lang . "’";
sc_lookup(rs, $get_content);

if (isset({rs[0][0]})) // Row found
{
$title = {rs[0][0]};
$content = {rs[0][1]};
}
else // No row found
{
$title = ‘ERROR’;
$content = ‘ERROR’;
}