Elxis CMS Forum

International zone => فارسی - Persian => Topic started by: Kamran on April 03, 2012, 13:36:18

Title: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 03, 2012, 13:36:18
Hi,

Please let me know how I can have فارسی instead of persian in "select language". I mean I want to change the text style.

Thanks,
Kamran
Title: Re: how to have فارسی instead of persian in "select language"
Post by: apkoutsou on April 03, 2012, 15:21:06
In front or back end? In both cases you have to change the language files.
Title: Re: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 04, 2012, 10:12:36
Hi apkoutsou,

I meant in front end. I guess I have to add
define('      ', 'فارسی');
to persian.php file in language directory. Am I right? In this case what should I write between '    ' marks?

thanks for your help.
Kamran
Title: Re: how to have فارسی instead of persian in "select language"
Post by: apkoutsou on April 04, 2012, 22:41:57
I look better into it and I was wrong! Unfortunately you have to change the languge module php code. The problem is that the language module pools languages name from the configuration.php file. But if you change the configuration file so that instead of persian to return فارسی the module will not work at all.

So replace lines 221-227 of /modules/mod_language.php file to this:
Code: [Select]
if ($langx == 'persian') {
$persianlang = 'فارسی';
echo '<a href="'.$link.'" title="'.$persianlang.'">';
if (($this->lng_style == 0) && file_exists($mainframe->getCfg('absolute_path').'/language/'.$langx.'/'.$langx.'.gif')) {
echo '<img src="'.$mainframe->getCfg('ssl_live_site').'/language/'.$langx.'/'.$langx.'.gif" border="0" alt="'.$persianlang.'" style="vertical-align:middle" />';
} else {
echo ($lang == $langx) ? '<strong>'.$persianlang.'</strong>' : $persianlang;
}
echo '</a> '._LEND;
} else {
echo '<a href="'.$link.'" title="'.$langx.'">';
if (($this->lng_style == 0) && file_exists($mainframe->getCfg('absolute_path').'/language/'.$langx.'/'.$langx.'.gif')) {
echo '<img src="'.$mainframe->getCfg('ssl_live_site').'/language/'.$langx.'/'.$langx.'.gif" border="0" alt="'.$langx.'" style="vertical-align:middle" />';
} else {
echo ($lang == $langx) ? '<strong>'.$langx.'</strong>' : $langx;
}
echo '</a> '._LEND;
}

I cannot test it, but I think that this will work for you...
Title: Re: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 05, 2012, 08:34:06
Hi apkoutsou,

Thank you for your help.
I replaced the codes and persian is replaced by فارسی in language selection in front end but its link does not work. In other words, I cannot link to persian pages and only english pages are working. Please let me know what I should do now.

Thanks,
kamran
Title: Re: how to have فارسی instead of persian in "select language"
Post by: apkoutsou on April 05, 2012, 17:55:02
That is strange...  :-\ The link is not affected by the above changes...
Could you please give me the url of your site? I'll check it it tonight, and I'd prefer to see the live site.
Title: Re: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 05, 2012, 20:05:53
the live website address is: http://www.payab-zamzam.com/PZnewSite

thanks,
Title: Re: how to have فارسی instead of persian in "select language"
Post by: apkoutsou on April 05, 2012, 22:07:29
Kamran, which version of Elxis have you installed on your site?
Title: Re: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 06, 2012, 10:14:40
It is 2009.3_aphrodite_rev2684
Title: Re: how to have فارسی instead of persian in "select language"
Post by: Kamran on April 07, 2012, 14:32:18
Hi apkoutsou,

I moved forward a little bit by adding

$link = $this->sefReplacer($langx);

to lines 223 and 232. Now, select language is working but what I don't like about it is that whenever I click the active language the page refreshes whereas it should not have any reaction, I guess.
The actual code is:

if ($langx == 'persian') {
   $persianlang = 'فارسی';
   $link = $this->sefReplacer($langx);
            echo '<a href="'.$link.'" title="'.$persianlang.'">';
   if (($this->lng_style == 0) && file_exists($mainframe->getCfg('absolute_path').'/language/'.$langx.'/'.$langx.'.gif')) {
      echo '<img src="'.$mainframe->getCfg('ssl_live_site').'/language/'.$langx.'/'.$langx.'.gif" border="0" alt="'.$persianlang.'" style="vertical-align:middle" />';
   } else {
                        echo ($lang == $langx) ? '<strong>'.$persianlang.'</strong>' : $persianlang;
   }
   echo '</a> '._LEND;
} else {
   $link = $this->sefReplacer($langx);
            echo '<a href="'.$link.'" title="'.$langx.'">';
   if (($this->lng_style == 0) && file_exists($mainframe->getCfg('absolute_path').'/language/'.$langx.'/'.$langx.'.gif')) {
      echo '<img src="'.$mainframe->getCfg('ssl_live_site').'/language/'.$langx.'/'.$langx.'.gif" border="0" alt="'.$langx.'" style="vertical-align:middle" />';
   } else {
                       echo ($lang == $langx) ? '<strong>'.$langx.'</strong>' : $langx;
   }
            echo '</a> '._LEND;
}

I appreciate your letting me the solution for the problem.

Thanks,
kamran
Title: Re: how to have فارسی instead of persian in "select language"
Post by: apkoutsou on April 09, 2012, 09:42:34
Hi Kamran,

I'm sorry I couldn't respond sooner; I had a work-loaded weekend...

The module code differs in every Elxis version, so we should make changes depending on the installed version.

But I see that you solved the problem! That's very nice. The current language should refresh the page anyway, so you do not have to worry. Otherwise, you have to remove the a tag from the current language.
Title: Re: how to have فارسی instead of persian in "select language" - Solved
Post by: Kamran on April 09, 2012, 13:16:57
noted, thanks.