2009-08-16, 06:26:05
wizzy Wrote:Unfortunately I didn't find suitable regex (but will continue to check)
found a solution - converts any page slug/url containing -de- or -en- or -es- into links to the corresponding pages
HOW?
1) define a new component and paste the following php code:
Code:
<?php
$srcurl = $_SERVER["REQUEST_URI"];
echo '<a href="'.ereg_replace("-de-|-es-","-en-",$srcurl).'" title="english">en</a> | ';
echo '<a href="'.ereg_replace("-en-|-es-","-de-",$srcurl).'" title="deutsch">de</a> | ';
echo '<a href="'.ereg_replace("-en-|-de-","-es-",$srcurl).'" title="español">es</a>';
?>
2) paste get_component() wherever you want to offer the language- switch
3) enjoy!