How to show one language rather than 2

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
joecannes
Forum Members
Forum Members
Posts: 93
Joined: Mon Nov 26, 2007 5:00 pm
Location: Montreal, Quebec

How to show one language rather than 2

Post by joecannes »

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)
alby

Re: How to show one language rather than 2

Post by alby »

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)
In this moment no.
It will come out with 1.5

Alby
smansman
Forum Members
Forum Members
Posts: 28
Joined: Wed Apr 23, 2008 6:08 pm

[solved] How to show one language rather than 2

Post by smansman »

alby wrote:
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)
In this moment no.
It will come out with 1.5

Alby
Actually there is a lazy hack about it even on version 1.4.x (at least I did it there)
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.
Locked

Return to “[locked] CMSMS MLE fork”