I am creating a MLE site in 2 languages (English and french)
I am using this code in my template:
{lang text='true'}
and it shows me both "English Francais" as my links...
How do I modify it, so when I am in the french portion of the website, I see only the "English" link, and when I am in the english portion of the website, I only see a "Francais" link? (rather than both)
How to show one language rather than 2
Re: How to show one language rather than 2
In this moment no.joecannes wrote: How do I modify it, so when I am in the french portion of the website, I see only the "English" link, and when I am in the english portion of the website, I only see a "Francais" link? (rather than both)
It will come out with 1.5
Alby
[solved] How to show one language rather than 2
Actually there is a lazy hack about it even on version 1.4.x (at least I did it there)alby wrote:In this moment no.joecannes wrote: How do I modify it, so when I am in the french portion of the website, I see only the "English" link, and when I am in the english portion of the website, I only see a "Francais" link? (rather than both)
It will come out with 1.5
Alby
you go to dir Where_You_Have_Installed_cmsms/plugins/ and find function.lang.php and copy it in the same dir (Where_You_Have_Installed_cmsms/plugins/) with another name like function.langb.php (notice the b after lang) after you edit file and go to about line 19...
function smarty_cms_function_lang($params, &$smarty)
and change to...
function smarty_cms_function_langb($params, &$smarty)
(notice again the b actually you can use any name u want but have to rename appropriately the function name )
and then go to line's 58, 78, 95 and change...
$selector .= "$link$spacer";
to...
//$selector .= "$link$spacer"; (or delete that code from there)
also go to line 114 and change...
function smarty_cms_help_function_lang() {
to...
function smarty_cms_help_function_langb() {
and line 132...
function smarty_cms_about_function_lang() {
to...
function smarty_cms_about_function_langb() {
and you are done of course you could do it more elegant and change code of function.lang.php by adding an extra param like (on line 35)
$hideflag = '';
if(isset($params['hideflag'])) $hideflag = $params['hideflag'];
and instead of deleteing the...
$selector .= "$link$spacer";
change it to...
if ($hideflag!=true){$selector .= "$link$spacer";}
and call it like from template like {$lang hideflag='true'}
that way the flag of the current browsing lang will not be shown so if you have 2 lang always seeing the other langs flag or if you have more langs the current will not show

although it's a long time since the question was raised hope it helps someone
Last edited by Anonymous on Wed Jan 21, 2009 10:13 pm, edited 1 time in total.