Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

mwp_language_switcher_panel

Asked Modified Viewed 2,882 times
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

Hi I have downloaded "mwp_language_switcher_panel".
I'am trying to switch between 2 languages and
everything working properly, except the"

openside($locale['MWPLS001']);

Always brings me English Locale Panel label(Language) and not the
Locale Panel label of the other language(Greek in my case) ...

The code:

<?php
/*
   Developer: Marwelln (Marwelln@gmail.com)
   WWW: http://engine.redward.org
   Released under the AGPL license
*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
$infdir = INFUSIONS."mwp_language_switcher_panel/";

if (file_exists($infdir."locale/".$settings['locale'].".php")) {
   include $infdir."locale/".$settings['locale'].".php";
}
else {
   include $infdir."locale/English.php";
}

$localefiles = makefilelist(LOCALE, ".|..", true, "folders");

[b]openside($locale['MWPLS001']);
[/b]   if (isset($_POST['newlang'])) {
      if (isset($_COOKIE['newlang'])) setcookie("newlang", $_COOKIE['newlang'], time()-3600);
      setcookie("newlang", $_POST['newlang'], time()+3600*60*60, "/");
      header("Location: ".$_SERVER['REQUEST_URI']);
      exit;
   }
   
   if (isset($_COOKIE['newlang']) && !in_array($_COOKIE['newlang'], $localefiles)) {
      setcookie("newlang", $_COOKIE['newlang'], time()-3600, "/");
      header("Location: ".$_SERVER['REQUEST_URI']);
      exit;
   }
   if(isset($_COOKIE['newlang'])){
   echo "<div style='text-align:center;'>
         <form name='langswitcherform' method='post' action=''>
            <select name='newlang' class='textbox' style='width:100px 'onchange='document.langswitcherform.submit();'>";
            foreach ($localefiles as $lfiles) {
               echo "<option value='$lfiles' ".($_COOKIE['newlang'] == $lfiles ? "selected='selected'" : "").">$lfiles</option>";
            }
   echo "      </select>
         </form>
       </div>";
   }
   else {
   echo "<div style='text-align:center;'>
         <form name='langswitcherform' method='post' action=''>
            <select name='newlang' class='textbox' style='width:100px 'onchange='document.langswitcherform.submit();'>";
            foreach ($localefiles as $lfiles) {
               echo "<option value='$lfiles' ".($settings['locale'] == $lfiles ? "selected='selected'" : "").">$lfiles</option>";
            }
   echo "      </select>
         </form>
       </div>";   
   }
closeside();
?>



Any suggestion?

Thanks for your great support!!!
Edited by spyrou on 25-11-2014 22:12,
0 replies

17 posts

R
Rimelek
R
  • Senior Member, joined since
  • Contributed 301 posts on the community forums.
  • Started 23 threads in the forums
answered
Senior Member

Quote


English.php and greek.php
- by spyrou


greek.php or Greek.php ? Try it with upper case G.

I don't know this panel. It is for v7? It sets cookie, but I didn't find 'newlang' cookie used by fusion v7.
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Any suggestion in the code please?
0 replies
R
Rimelek
R
  • Senior Member, joined since
  • Contributed 301 posts on the community forums.
  • Started 23 threads in the forums
answered
Senior Member

I don't know what this panel do unless it has other parts you didn't quote, but I don't think you need to change anything in the code. Check your locale filename. Have you already checked it as I suggested you?
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Yes I have!
Take a look what exist in my locale folder:

locale/English.php
<?php
$locale['MWPLS001'] = "Language";
?>

locale/Greek.php
<?php
$locale['MWPLS001'] = "Glossa";
?>

When the switcher is in English language then the panel's label is "Language" but when the switcher is in Greek language then the panel's label still be "Language" and not "Glossa" who is the exact word for "Language" in Greek... That's why I think that there is must be an error in the panel's code...

Thank's for your support!
0 replies
D
dimki
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

hi spyrou you ar from rodos ?
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Yes
0 replies
R
Rimelek
R
  • Senior Member, joined since
  • Contributed 301 posts on the community forums.
  • Started 23 threads in the forums
answered
Senior Member

Quote

When the switcher is in English language then the panel's label is "Language" but when the switcher is in Greek language then the panel's label still be "Language" and not "Glossa" who is the exact word for "Language" in Greek...
- by spyrou


The panel does not do anything besides setting a cookie. Even if it affected the title of the panel it would not change the locale of your site. The actual locale comes from $settings depending on your settings. The panel could work only if it changed the settings in the database or directly the variable before loading any other panel and infusion.

Is it the whole code? Is there other file which does what I wroted in the previous paragraph?

You can switch the language of the site and only the panel's title remains english? If it happens, I don't know why. Are you sure you have a compatible version with your fusion?
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Yes only the title of panel does not change!!!
Yes it is the whole code...
0 replies
D
dimki
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

compatible version with your fusion version beta 9 working i think :|


ok spyros
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

I'am working it with version 7.02.07 and Atom-X theme.
Here is the testing url http://easynetweb.eu/atomx/articles.php
and the panel is the 3rd from the left...
0 replies
D
dimki
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

Spyru teste the new version phpfusion 09 beta 2B)
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Atom-X working with this version Phpfusion 9 beta 2?
0 replies
D
dimki
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

I know how can I download version 9...
My question was "Atom-X working with this version Phpfusion 9 beta 2?" Dimki.
0 replies
D
dimki
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
answered
Senior Member

don't know :| I think not
0 replies
S
spyrou
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Any other infusion which can doing the same thing with this please?
0 replies
K
KasteR
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

spyrou, if your site's locale is not set to Greek, it will default to English.
$settings['locale']

Refers to what you have set here:
Admin > Settings > Main > Site locale

Are you wanting your site in English, and the label to display in Greek? An obvious solution would be to modify the English locale to the desired label text.
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 17 posts
  • Votes 0 votes
  • Topic users 4 members

4 participants

D
D
dimki 10
  • Senior Member, joined since
  • Contributed 246 posts on the community forums.
  • Started 28 threads in the forums
S
S
spyrou 10
  • Junior Member, joined since
  • Contributed 31 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
K
K
KasteR 10
  • Senior Member, joined since
  • Contributed 290 posts on the community forums.
  • Started 1 thread in the forums
R
R
  • Senior Member, joined since
  • Contributed 301 posts on the community forums.
  • Started 23 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet