Welcome, Guest. Please login or register.
Did you miss your activation email?
23 Jul 2008, 14:08

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: 1 2 [3] 4 5
Print
Author Topic: Multilanguage CMSMS MLE version 1.1.1 - 1.1.2  (Read 16667 times)
0 Members and 1 Guest are viewing this topic.
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #30 on: 15 Sep 2007, 15:35 »

Thanks but I am so sorry - I don't think I made myself very clear! - the url is the one generated for each page and not related to any module - specifically the ampersand in the urls calling the pages:

http://mydomain/yc/yc2/index.php?page=help-and-advice&hl=cy_GB

It's in link generated from {lang}, in menu of MenuManager or other?

Alby
Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
chipper
Forum Member
*

Karma: 0
Offline Offline

Posts: 42


« Reply #31 on: 15 Sep 2007, 17:36 »

It's in both I think - clicking on the menu tabs brings up a url with a single ampersand and so does clicking on the flags

Logged
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #32 on: 15 Sep 2007, 17:57 »

It's in both I think - clicking on the menu tabs brings up a url with a single ampersand and so does clicking on the flags

I don't find single ampersand in code.
Have you site online?

Alby
Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
chipper
Forum Member
*

Karma: 0
Offline Offline

Posts: 42


« Reply #33 on: 15 Sep 2007, 18:02 »

Yes it's here - just a basic shell at the moment as we are transferring an existing site over and I am getting the technical details out of the way first!

http://colonyofants.co.uk/yc/yc2

and an example url:

http://colonyofants.co.uk/yc/yc2/index.php?page=relationships&hl=en_GB

 Smiley
Logged
gk
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« Reply #34 on: 15 Sep 2007, 18:20 »

I've got this site (www.globalconceptfrance.com) that I'd like to be multilingual (done all you said, upgrading from cmsms v1.1.1 to mle v1.1.2, sql stuffs and so on) but it's not working smoothly. In fact, I can't get to the English page to display when UK flag being clicked, thaugh  I've succeeded displaying those pages before. Everything is showing fine in admin!! Is there a cache issue or something wrong in my config ?

1. In admin: I suppose that Title, Menu text and content are ok in fr_FR and en_GB pages?
2. Clear cache (absolutly like in CMSMS if modify template, module templates and css)
3. Work? No? Ok, it has happened to me once with pretty url enabled.
    Download this file and uncompress (overwrite) in /plugins and report this if work


My other $0.02:

1. Language page
Substitute in your template:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="FR">
with:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$currlang}" lang="{$currlang}">



2. Title Image

2a. Substitute in style CSS:

Code:
h1#this {
   background:url(uploads/images/h1-desodorisant.gif) no-repeat transparent;text-indent:-5000px;height:54px;
}
h1#that {
   background:url(uploads/images/h1-modeles.gif) no-repeat transparent;text-indent:-5000px;height:62px;
}
h1#thus {
   background:url(uploads/images/h1-presentoir.gif) no-repeat transparent;text-indent:-5000px;height:34px;
}

with:
Code:
h1#this_en_GB {
   background:url(uploads/images/h1-desodorisant_en_GB.gif) no-repeat transparent;text-indent:-5000px;height:54px;
}
h1#this_fr_FR {
   background:url(uploads/images/h1-desodorisant_fr_FR.gif) no-repeat transparent;text-indent:-5000px;height:54px;
}

h1#that_en_GB {
   background:url(uploads/images/h1-modeles_en_GB.gif) no-repeat transparent;text-indent:-5000px;height:62px;
}
h1#that_fr_FR {
   background:url(uploads/images/h1-modeles_fr_FR.gif) no-repeat transparent;text-indent:-5000px;height:62px;
}

h1#thus_en_GB {
   background:url(uploads/images/h1-presentoir_en_GB.gif) no-repeat transparent;text-indent:-5000px;height:34px;
}
h1#thus_fr_FR {
   background:url(uploads/images/h1-presentoir_fr_FR.gif) no-repeat transparent;text-indent:-5000px;height:34px;
}

2b.
- Rename h1-desodorisant.gif to h1-desodorisant_fr_FR.gif
- Create a new h1-desodorisant_en_GB.gif with English text

and same for h1-modeles and h1-presentoir

2c. Substitute, in template, <h1 id="this"> => <h1 id="this_{$lang}">
and same for that and thus


Alby
Hey this seems to be a full pack of cure methode!!
Thanx for taking the time to help, I'll let you know as soon as I try.
Logged
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #35 on: 16 Sep 2007, 03:14 »

Yes it's here - just a basic shell at the moment as we are transferring an existing site over and I am getting the technical details out of the way first!
http://colonyofants.co.uk/yc/yc2

and an example url:
http://colonyofants.co.uk/yc/yc2/index.php?page=relationships&hl=en_GB

On http://validator.w3.org homepage is ok (but I choice Validate by Direct Input because Validate by URI result 404 error!):
This Page Is Valid XHTML 1.0 Transitional!

In page there are errors!


Menu is ok (home and page):

Quote
<li><a href="http://colonyofants.co.uk/yc/yc2/index.php?page=whats-on&amp;hl=en_GB"><dfn>2: </dfn>Whats On</a>
</li>
<li><a href="http://colonyofants.co.uk/yc/yc2/index.php?page=free-time-2&amp;hl=en_GB"><dfn>3: </dfn>Free Time and Fun</a>
</li>

In lang there is a problem:

Home, ok:
Quote
<div class="StyleClassForThisTag_en_GB"><a href="/yc/yc2/index.php?&amp;hl=en_GB"><img src="images/lang/en_GB.png" style="border:0" alt="en_GB" /></a>
<a href="/yc/yc2/index.php?&amp;hl=cy_GB"><img src="images/lang/cy.png" style="border:0" alt="cy_GB" /></a>
</div>

Page no:
Quote
<div class="StyleClassForThisTag_en_GB"><a href="/yc/yc2/index.php?page=relationships&hl=en_GB"><img src="images/lang/en_GB.png" style="border:0" alt="en_GB" /></a>
<a href="/yc/yc2/index.php?page=relationships&hl=cy_GB"><img src="images/lang/cy.png" style="border:0" alt="cy_GB" /></a>
</div>

In page template you use tag {lang} or is manual entry?

 Roll Eyes StyleClassForThisTag was a generic name of style  Roll Eyes

Alby
« Last Edit: 16 Sep 2007, 04:03 by alby » Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
chipper
Forum Member
*

Karma: 0
Offline Offline

Posts: 42


« Reply #36 on: 16 Sep 2007, 06:10 »

Hi Alby

Scrap what I wrote last night - think I was rambling - brain strain due to doing this!!!  Roll Eyes Getting my urls mixed up!

I have been playing around this morning, searching the forum etc - didn't find the exact answer so I investigated what could possibly be changed in function.lang and I have now got the site to validate! I have shocked myself  Shocked

I don't know if this was the correct way to go about things. (The bolded bits are the changes. It looks odd to me but when I had &amp; two ampersands were added to the url in the code throwing up another error):

Quote
function smarty_cms_function_lang($params, &$smarty)
{
   global $gCms;
   $config = &$gCms->GetConfig();

   global $hls;
   global $argv;
   $spacer = '';
   if(isset($params['spacer'])){
      $spacer = " " . $params['spacer'];
   }
   $query_string = $_SERVER['argv'][0];
   $selector = '';
   if (!isset($hls)){
      echo "Languages not set!";
      return false;
   }

   if ($config["assume_mod_rewrite"])
   {
      $hasparams = false;
      $lankey = 0;
      $thepage = (isset($params['defaultpage']) ? $params['defaultpage'] : 'home.html');
      foreach ($hls as $key => $mle)
      {
         $url_parts = explode("/", $_SERVER['PHP_SELF']);
         foreach ($url_parts as $url_part_key => $url_part_value)
         {
            if($key == $url_part_value)
            {
               $thepage = $url_parts[$url_part_key+1];
               break;
            }
         }

         $link_url = $config["root_url"] . "/" . $key . "/" . $thepage;
         $selector .= '<a href="' . $link_url.'">'.$mle['flag']."</a>".$spacer."\n";
      }
   }
   else if ($config['internal_pretty_urls'])
   {
      $lan = '';
      $thispage = $_SERVER['PHP_SELF'];
      $url_parts = explode("/", $thispage);
      foreach ($url_parts as $url_part_key => $url_part_value)
      {
         foreach ($hls as $key => $mle)
         {
            if($key == $url_part_value)
            {
               $lan = $key;
               break;
            }
         }
      }
      if($lan==''){
         $lan = DEFAULT_LANG;
         $thispage .= "/" . $lan . "/" .
            (isset($params['defaultpage']) ? $params['defaultpage'] : 'home');
      }
      $url_chunks = explode("/$lan/", $thispage);
      $thepage = $url_chunks[1];
      foreach ($hls as $key => $mle)
      {
         $link_url = $url_chunks[0] . "/". $key . "/" . $thepage;
         $selector .= '<a href="' . $link_url.'">'.$mle['flag']."</a>".$spacer."\n";
      }
   }
   else
   {
      if(strstr($query_string, "hl=")){
         foreach ($hls as $key => $mle) {
            $link_url = $_SERVER['PHP_SELF'] . "?" . ereg_replace("hl=[_a-zA-Z0-9]+", "amp;hl=".$key, $query_string);
            $selector .= '<a href="' . $link_url.'">'.$mle['flag']."</a>".$spacer."\n";
         }
      }
      else
      {
         foreach ($hls as $key => $mle) {
            $link_url = $_SERVER['PHP_SELF'] . "?" . $query_string . "amp;hl=".$key;
            $selector .= '<a href="' . $link_url.'">'.$mle['flag']."</a>".$spacer."\n";
         }
      }
   }

   if($spacer != ''){
      $length = strlen($spacer);
      $selector = substr($selector, 0, -1*($length+1));
   }

   return $selector;
} ## smarty_function_cms_version

function smarty_cms_help_function_lang() {
   ?>


With this I get valid xhtml transitional markup. There could be a flaw in this somewhere but haven't found it yet so over to you!

And how dumb am I? (StyleClassForThisTag)  - I have now renamed the class. I thought it was some clever code thing!  Roll Eyes

As ever - grazie

Regards
Lynne



Logged
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #37 on: 16 Sep 2007, 10:48 »

Scrap what I wrote last night - think I was rambling - brain strain due to doing this!!!  Roll Eyes Getting my urls mixed up!

I have been playing around this morning, searching the forum etc - didn't find the exact answer so I investigated what could possibly be changed in function.lang and I have now got the site to validate! I have shocked myself  Shocked

I don't know if this was the correct way to go about things. (The bolded bits are the changes. It looks odd to me but when I had &amp; two ampersands were added to the url in the code throwing up another error):
...........
                                                                                                                                                                                                                                         
Download function.lang.php update from Reply #30 and overwrite
I am testing this for new release

Alby
« Last Edit: 17 Sep 2007, 05:13 by alby » Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
josin
Forum Member
*

Karma: 0
Offline Offline

Posts: 2


« Reply #38 on: 17 Sep 2007, 04:46 »

Hi. Is it possible to use mod_rewrite whit CMSMS MLE? I tried to use it but it worked just in DEFAULT_LANG version. I couldn't change lang ... Thx for anwer

P.S.: Good work alby!
Logged
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #39 on: 17 Sep 2007, 05:12 »

Hi. Is it possible to use mod_rewrite whit CMSMS MLE? I tried to use it but it worked just in DEFAULT_LANG version. I couldn't change lang ... Thx for anwer

It's possible but I am not a guru in mod_rewrite.
.htaccess may reflect this:
www.mysite.com/it_IT/alias
from www.mysite.com/index.php?page=alias&hl=it_IT

.htaccess for normal CMSMS is:
www.mysite.com/alias
from www.mysite.com/index.php?page=alias

Ask in a new topic for help
PS: Download function.lang.php update from Reply #30 and overwrite
I am testing this for new release with 1.2


P.S.: Good work alby!

Thank you very much but Katon and devs also

Alby
Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
alby
Member Support Team
Moderator
Power Poster
*****

Karma: 104
Offline Offline

Posts: 2413

Location: Ferrara, Italy


My kids


« Reply #40 on: 17 Sep 2007, 05:44 »

Hi. Is it possible to use mod_rewrite whit CMSMS MLE? I tried to use it but it worked just in DEFAULT_LANG version. I couldn't change lang ... Thx for anwer

I don't read anymore

From your post:
Quote
but it doesn't work. It works, but you can't change lang.

If you change URL (edit) from:
www.mysite.com/DEFAULT_LANG/alias
to:
www.mysite.com/OTHER_LANG/alias
work?

If yes, replace new function.lang.php, check and report

Alby
Logged

HOLIDAY:   15 July - 31 July

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple - Howto (FMS)

Multilingual: CMSMS MLE 1.3.1 - Doc/Howto/Tips (#10)
josin
Forum Member
*

Karma: 0
Offline Offline

Posts: 2


« Reply #41 on: 17 Sep 2007, 07:07 »

I made update function.lang.php (#30) and replace this RewriteRule
Code:
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
by
Code:
RewriteRule ^([^/]+)/(.+)$ index.php?page=$2&hl=$1 [QSA]
and it works! You can include it in new MLE version  Smiley
Logged
gk
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« Reply #42 on: 17 Sep 2007, 09:01 »

Hello Alby,
These few words to say that you helped me solve the issue. Things are going the right way. Now I can focus on design and deal with the tricks you mention as for finalising the multilingual option.
Again thank you!!
Logged
chipper
Forum Member
*

Karma: 0
Offline Offline

Posts: 42


« Reply #43 on: 17 Sep 2007, 17:29 »

Hi Alby

Quote
In page template you use tag {lang} or is manual entry?

Missed this one sorry -  Here's an answer:

Yes the lang tag is in the template. When you say manual entry did you mean did I code it myself?

(not sure of the term)

Am still working on your last advice - will get back to you when I am done - just having an issue with the lang flags not working with the new function.lang file - very possibly something I have done wrong so am checking.

Fast learnining curve this!

Regards
Lynne
Logged
andreTTi
Forum Member
*

Karma: 0
Offline Offline

Posts: 6

Location: Sweden



« Reply #44 on: 20 Sep 2007, 15:59 »

Hi alby and thank you for your great work!

I have installed cmsms mle 1.1.2 and so far it works great except for one small thing. For some reason firefox chooses english as default language although I have configured swedish as default. (With Opera and IE6 it's working and swedish is default)
I tried to follow your instructions as closely as possible but maybe I got somehing wrong..

This is my config_lang.php:
define('DEFAULT_LANG', 'sv_SE');

$hls = array(

 'en_US' => array(
   'block'=>'en',
   'flag'=>'<img src="images/lang/en_US.png" style="border:0" alt="en_US" />',
 ),
 'sv_SE' => array(
   'block'=>'sv',
   'flag'=>'<img src="images/lang/se.png" style="border:0" alt="se" />',
   'locale'=>'sv_SE',
 ),


Actually i'm not sure about 'locale'=>'sv_SE' ? Is this correct? If not, where can I find the correct locale?

In config.php locale is left empty. ($config['locale'] = ''Wink

In Site Admin->Global Settings, "Default language for the frontend:" = "No default selected"

What do you mean by "current language (in this way CMSMS load current locale language for ALL modules)"?

In firefox a cookie named "mle" is set to "en_US" when I go to my frontpage. In Opera it is set to "sv_SE" as it should. Default language is set to Swedish in both firefox and opera.

I'm using firefox 2.0.0.7

Maybe it is a bug in firefox? 

Is there a way to force all browser to use swedish as default?

Ok, maybe that's enough questions for now..  Smiley

Thanks!
Logged
Pages: 1 2 [3] 4 5
Print
Jump to: