Language Issue (SOLVED)

Started by Rich, November 04, 2013, 09:26:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rich

Managed to solve the issue.

error_message_center("success", "{$lang['gbl_success']}", "<strong>{$lang['text_created']}</strong><br />
                                         <br /> ".sprintf($lang['text_user_added'], "<a href='$site_url/userdetails.php?id=$arr[0]'>","</a>")."
                                         <br /> ".sprintf($lang['text_ret_add'], "<a href='controlpanel.php?fileaction=5'>","</a>")."
                                         <br /> ".sprintf($lang['text_return_home'], "<a href='index.php'>","</a>")."");


<?php

$lang 
= array(
'text_return_home' => 'Return to %s Main Page %s',
'text_ret_add'     => 'Return to %s Add User Page %s',
'text_user_added' => 'View The New Members %s Details Page %s');

?>

Rich

#1
Could someone please have a look at the code below and maybe show me the light on how to correctly code this.  I can get it to work but for some reason it is not passing the correct userdetails id through!

I know that I'd need to use sprintf and %s but I cannot get the syntax correct.  It directs me to id=$arr[0] not the users id. :(

error_message_center("success", "{$lang['gbl_success']}", "<strong>{$lang['text_created']}</strong><br />
                                         <br /> View The New Members <a href='$site_url/userdetails.php?id=$arr[0]'>Details Page</a>
                                         <br /> {$lang[text_ret_add]}
                                         <br /> {$lang[text_return_home]}");


I know that this is not correct and is just one example of what I've tried in the above  {$lang['text_user_added'} and then in the lang file 'text_user_added' => 'View The New Members %s Details Page %s'

I've also tried many other variations but I've not hit the correct solution :(  Can anyone please provide the correct syntax to use??