Elxis CMS Forum
International zone => فارسی - Persian => Topic started 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
-
In front or back end? In both cases you have to change the language files.
-
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
-
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:
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...
-
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
-
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.
-
the live website address is: http://www.payab-zamzam.com/PZnewSite
thanks,
-
Kamran, which version of Elxis have you installed on your site?
-
It is 2009.3_aphrodite_rev2684
-
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
-
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.
-
noted, thanks.