This topic is locked

multi-lingual graphics

9/1/2005 1:37:27 PM
PHPRunner General questions
C
crono999 author

I know how to change the text that is displayed on multi-lingual sites. However, I'm trying to change the text (such as "back to master table") to a graphical "Back" button. I want to keep the site multi-lingual, yet when i try to enter the reference to the images, it won't return it properly... for example:
/include/languages.php:
changing:

$mlang_messages["English"]["BACK_TO_MASTER"]="Back to Master table";
to:

$mlang_messages["English"]["BACK_TO_MASTER"]='<img src="/include/images/english_back.gif">;
returns &quot; for each appearance of a " in the reference and therefore does not call the image. i've tried \" yet it still just returns \&quot;
once again, any help would be greatly appreciated

Sergey Kornilov admin 9/1/2005

Try this:

$mlang_messages["English"]["BACK_TO_MASTER"]="<img src=\"/include/images/english_back.gif\">";

C
crono999 author 9/1/2005

nope... i tried this:
$mlang_messages["English"]["BACK_TO_MASTER"]="<img src=\"/images/english.gif\" border=0>";
and got the red "x" on the page, and the source shows this:
<img src=&quot;/images/english.gif&quot; border=0>
...it's probably something simple that i'm just not seeing...

Sergey Kornilov admin 9/2/2005

Hi,
to prevent replacing quotest with &quot; you can do the following:

Open languages.php file and find mlang_message function there.
Then replace

return str_replace(array("\"","'"),array("&quot;","’"),@$mlang_messages[mlang_getcurrentlang()][$tag]);



with

return str_replace(array("'"),array("’"),@$mlang_messages[mlang_getcurrentlang()][$tag]);


However this may cause some errors in other places, so the more secure way to make the changes is to create a copy of mlang_messagefunction, i.e. mlang_message1, modify it the above way, then find mlang_message("BACK_TO_MASTER") in ..._list.php file and replace it with mlang_message1("BACK_TO_MASTER")

C
crono999 author 9/2/2005

yup, that worked, thanks once again