<?php
$pageurl = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$pageurl_noslashes = str_replace("/","",$pageurl);
$lang = substr($pageurl_noslashes,-3);
echo $lang;
?>
{exp:channel:entries channel="products" limit="10"}
<p>Product title: <span>{if title<?php echo $lang; ?>} {title<?php echo $lang; ?>} {if:else} {title} {/if}</span></p>
{/exp:channel:entries}
Ben uygun dil değişkenleri dönmek için ifade motoru hack duyuyorum.
Ben dil kodunu (fr / tr / etc ...) alıyorum yolu ben onu tavsiye gerekir neden olan, ideal olmaktan uzak olduğunun farkındayım :)
Ne olur:
- host.com / products / item / _fr / - yükler Fransızca
- host.com / products / item / _tr / - yükler İngilizce
- host.com / products / item / - yükler İngilizce (eğer koşul başarısız sonra)
Yani özünde, ben tam olarak ne istediğini, ancak ben bunu yapmak için en iyi yol olmadığını hissediyorum.