coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: LFox on April 17, 2008, 11:25:56 PM

Title: [Solved]: anycontent.php and other languages...
Post by: LFox on April 17, 2008, 11:25:56 PM
How to add anycontent.php text to russian.php and english.php? I need to show anycontent.php on different languages, when user choose their language, anycontent.php will translate)
Title: Re: anycontent.php and other languages...
Post by: Stramm on April 18, 2008, 08:12:51 AM
switch($USER['lang']){
case "russian":
echo "russian";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch
Title: Re: anycontent.php and other languages...
Post by: LFox on April 18, 2008, 12:48:25 PM
thanks!) and can you say where in the anycontent I must put it?
And how add text from anycontent to russian.php etc.?
Title: Re: anycontent.php and other languages...
Post by: François Keller on April 18, 2008, 01:52:41 PM
you d'ont have to put text in the lang file, in stramm's code, you have to replace "russian" for exemple with the russian text you will show...
Title: Re: anycontent.php and other languages...
Post by: LFox on April 18, 2008, 03:13:11 PM
ooh, I don't understood then)))
If so, That's GREAT!!! Thank you once again Stramm!!!
And thank you François for explaining!)
Title: Re: anycontent.php and other languages...
Post by: LFox on April 18, 2008, 03:28:41 PM
amm... I have some problems with it...

When I put this code to anycontent with simple texts, example:

switch($USER['lang']){
case "russian":
echo "simple text on russian...";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch


it works well. But when I put there table, it get me an error, example:

switch($USER['lang']){
case "russian":
echo "<div align="center">
<table border="1" width="500" id="table2" bordercolorlight="#ffffff">
<tr>
<td width="100">
<p><ul>
<li><a href="http://www.example.com">Title 1</a></li>
<li><a href="http://www.example.com">Title 2</a></li>
<li><a href="http://www.example.com">Title 3</a></li>
</ul></p></td></tr>
</table></div>";
break;
case "serbian":
echo "serbian";
break;
default:
echo "default... eg. english";
} // switch


Is it means that I can't put there any tables, only text, or I do something wrong?
Title: Re: anycontent.php and other languages...
Post by: Stramm on April 18, 2008, 03:34:25 PM
read more about the php echo function here
http://php.net/manual/en/function.echo.php

probably most useful for you would be

echo <<<EOT
here comes the text you want to output. It can be table definition or whatever
<table>
<tr>
<td>
more yadda here
</td>
</tr>
</table>
EOT;
Title: Re: anycontent.php and other languages...
Post by: LFox on April 23, 2008, 11:41:05 AM
Thank you very much!!! Work's great!)