• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Thu Sep 20, 2007 8:38 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
andreTTi wrote:
Hi alby and thank you for your great work!


Thank you  ;D


andreTTi wrote:
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'=>'en_US',
),
'sv_SE' => array(
'block'=>'sv',
'flag'=>'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 Unix and shell account or create a php file with this command: locale -a
Code:
<?php
$output = shell_exec('locale -a');
echo $output;
?>


and check your locale strings, for Windows check in above Replies
I add this option for avoid locale problem on servers.
I think, for next release, the possibility of force DEFAULT_LANG in config_lang.php:
$force_default_lang = true/false; // Default: false


andreTTi wrote:
In config.php locale is left empty. ($config['locale'] = '';)

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


Ok  ;)


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


In normal mode CMSMS modules load en_US languages (load other language with lang params only)


andreTTi wrote:
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.


What are your languages in Firefox (Tools > Options > Advanced > General > Languages)?

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Fri Sep 21, 2007 8:29 am 
Offline
New Member
User avatar

Joined: Sat Jun 02, 2007 6:52 pm
Posts: 8
Location: Sweden
Thank you for the quick reply!

alby wrote:
In Unix and shell account or create a php file with this command: locale -a


I got the following replies:
Code:
sv_SE
sv_SE.iso88591
sv_SE.iso885915
sv_SE.utf8
swedish


So I guess 'locale'=>'sv_SE' should be ok then?

alby wrote:
I think, for next release, the possibility of force DEFAULT_LANG in config_lang.php:
$force_default_lang = true/false; // Default: false


That would be great!  :)

alby wrote:
andreTTi wrote:
In config.php locale is left empty. ($config['locale'] = '';)


Ok  ;)


That was supposed to be:
Code:
($config['locale'] = '';)
Don't worry, I'm not flirting with you! ;)

alby wrote:
What are your languages in Firefox (Tools > Options > Advanced > General > Languages)?


My languages in firefox is in the following order:
- Svenska [sv]                                       (swedish)
- Engelska/Förenta staterna [en-us]     (US english)
- Engelska [en]                                      (english)

I guess this is a bug in firefox since it working with opera and IE6..

Andreas


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Fri Sep 21, 2007 9:18 am 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
andreTTi wrote:
I got the following replies:
Code:
sv_SE
sv_SE.iso88591
sv_SE.iso885915
sv_SE.utf8
swedish


So I guess 'locale'=>'sv_SE' should be ok then?


Yes, but (maybe  ???) sv_SE.utf8 is better (if you use all  utf8)


andreTTi wrote:
My languages in firefox is in the following order:
- Svenska [sv]                                      (swedish)
- Engelska/Förenta staterna [en-us]    (US english)
- Engelska [en]                                      (english)


Ok, browser script check match in your language order with locale: sv_SE, en_US
sv not match with sv_SE or en_US
en-us (same to en_US) match with en_US

IF YOU DELETE [en-us] languages, script continue with:
en not match with sv_SE or en_US

after browser script re-check match in your language order with parent-locale: sv, en
sv match with sv

This script is a modify version of www.php.net script
I don't know if modify

I see for locale:
fi            Finnish
fi_FI        Finnish Finland
sv          Swedish
sv_FI      Swedish Finland
sv_SE      Swedish Sweden

What are languages in Swedish Finland (if exist) Firefox?

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Last edited by alby on Fri Sep 21, 2007 9:30 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Fri Sep 21, 2007 2:57 pm 
Offline
New Member
User avatar

Joined: Sat Jun 02, 2007 6:52 pm
Posts: 8
Location: Sweden
alby wrote:
Ok, browser script check match in your language order with locale: sv_SE, en_US
sv not match with sv_SE or en_US
en-us (same to en_US) match with en_US

IF YOU DELETE [en-us] languages, script continue with:
en not match with sv_SE or en_US

after browser script re-check match in your language order with parent-locale: sv, en
sv match with sv


I'm not sure if I understand this correctly but should'nt sv take precedence over en_US  ??? I'm mean since it's the "parentlocale" of sv_SE. Anyway, I have modified the function "language_user_setting" in function.mle.php to do so.

Here is the modified version:
Code:
function language_user_setting( $hls )
{
   $browser_langs = array();

   // Check if we have $_SERVER['HTTP_ACCEPT_LANGUAGE'] set and
   // it no longer breaks if you only have one language set :)
   if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
      $browser_accept = explode(",", $_SERVER['HTTP_ACCEPT_LANGUAGE']);

      // Go through all language preference specs
      for ($i = 0; $i < count($browser_accept); $i++) {
         // The language part is either a code or a code with a quality
         // We cannot do anything with a * code, so it is skipped
         // If the quality is missing, it is assumed to be 1 according to the RFC
         if (preg_match("!([a-z-]+)(;q=([0-9\\.]+))?!", trim($browser_accept[$i]), $found)) {
            $quality = (isset($found[3]) ? (float) $found[3] : 1.0);
            $browser_langs[] = array($found[1], $quality);
         }
         unset($found);
      }
   }

   // Order the codes by quality
   usort($browser_langs, "language_accept_order");

   $t_hls = transform_language_arr($hls);

   foreach($browser_langs as $browser_lang)
   {
      $language = trim($browser_lang[0]);
      if (strlen($language) == 2)
      {
         $language = strtolower($language);
         if (in_array($language, array_keys($t_hls))) return $t_hls["$language"];
      }
      else
      {
         // Check if $language in config
         $language = strtolower(substr($language, 0, 2)) .'_'. strtoupper(substr($language, 3, 2));
         if (in_array($language, array_keys($hls))) return $language;
      }
   }

   return DEFAULT_LANG;
}


This seems to work for me anyway. I don't know if this breaks something else, so use at own risk!  :)

Thanks again for your help Alby!

Andreas


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Fri Sep 21, 2007 3:52 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
andreTTi wrote:
I'm not sure if I understand this correctly but should'nt sv take precedence over en_US  ??? I'm mean since it's the "parentlocale" of sv_SE. Anyway, I have modified the function "language_user_setting" in function.mle.php to do so.


The problem is:
If you have a site with: en_GB, en_AU, en_US what languages if first?

TODO: I would want is to connect the plugin geolocate

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Sat Sep 22, 2007 1:16 pm 
Offline
New Member
User avatar

Joined: Sat Jun 02, 2007 6:52 pm
Posts: 8
Location: Sweden
alby wrote:
The problem is:
If you have a site with: en_GB, en_AU, en_US what languages if first?


No problem, for example if the browser is configured with en_AU, that language will be choosen. If the browser is configured with only the generic en, I guess the result would be a bit random (the first one in the list will probably be choosen). But in this case, is'nt it up to the browser to report correct locale in the first place?
I think this behavior is more correct than the original solution which selected an entire different language. (but of course I could be wrong. Maybe I don't have enough insight in how this is supposed to work?)  :)


On a sidenote, how hard would it be to adapt news module and album module to be multilingual?


Andreas


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE versione 1.1.2
PostPosted: Sat Sep 22, 2007 7:36 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
andreTTi wrote:

On a sidenote, how hard would it be to adapt news module and album module to be multilingual?



For News module I use this method:

Create plus category:
Home-en_US, Home-it_IT, Home-fr_FR

In template call module:
{news category="Home-$lang"}


For Album I must still try  ;)

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Sat Sep 22, 2007 7:37 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
I have upgrade to CMSMS 1.1.3.1  ;D
I started a new topic for this version ONLY

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Last edited by alby on Sat Sep 22, 2007 8:46 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Sun Sep 23, 2007 7:39 pm 
Offline
New Member

Joined: Sat Sep 22, 2007 6:54 pm
Posts: 3
I'm trying to set up a site in german and hungarian and got mod_rewrite working thanks to the tips here. However, I would prefer to have the URLs like www.domain.com/hu/... and www.domain.com/de/.... instead of www.domain.com/hu_HU/... and www.domain.com/de_DE/...

I know I can change in config_lang.php from hu_HU to hu, but I feel I'm not using the correct language selection than anymore. Hope you understand what I mean.

Thank you.
lapinkulta


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Sun Sep 23, 2007 8:10 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
lapinkulta wrote:
I'm trying to set up a site in german and hungarian and got mod_rewrite working thanks to the tips here. However, I would prefer to have the URLs like www.domain.com/hu/... and www.domain.com/de/.... instead of www.domain.com/hu_HU/... and www.domain.com/de_DE/...

I know I can change in config_lang.php from hu_HU to hu, but I feel I'm not using the correct language selection than anymore. Hope you understand what I mean.


Try to use locale in config_lang.php  ;)

'hu' => array (
  'block'=>'hu',
  'flag'=>'Hungarian',
  'locale'=>'hu_HU',
),

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Sun Sep 23, 2007 9:10 pm 
Offline
New Member

Joined: Sat Sep 22, 2007 6:54 pm
Posts: 3
now that has also a meaning to me  :D grazie alby


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Mon Sep 24, 2007 10:05 am 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
lapinkulta wrote:
now that has also a meaning to me  :D grazie alby


I have tried to have the maximum flexibility  ;)

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Wed Nov 14, 2007 1:20 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 13, 2007 12:01 am
Posts: 154
Hello

At the moment all the Lings will show follwing: http://www.otschuster.com/index.php?page=home&hl=es_ES

I would like tho show withe only es (not es_ES) ist that posible? How can i make it?

Another Problem. The Module Album for Photogallery will not show in multilanguage. How can i make it multilanguage for your MLE Edition?

Thank you for your help

Otty


Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Wed Nov 14, 2007 2:09 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4814
Location: Ferrara, Italy
ottyscom wrote:
At the moment all the Lings will show follwing: http://www.otschuster.com/index.php?page=home&hl=es_ES

I would like tho show withe only es (not es_ES) ist that posible? How can i make it?


Try in config_lang.php with:
'es_ES' = array(
        ......
      'locale' => 'es_ES',
);


ottyscom wrote:
Another Problem. The Module Album for Photogallery will not show in multilanguage. How can i make it multilanguage for your MLE Edition?


Album (comments) and many other modules are monolingual only.
Workaround (if there is that option) is set param lang="$lang" in calling module.

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Last edited by alby on Thu Nov 15, 2007 1:05 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multilanguage CMSMS MLE version 1.1.2
PostPosted: Thu Nov 15, 2007 12:52 pm 
Offline
Forum Members
Forum Members

Joined: Tue Nov 13, 2007 12:01 am
Posts: 154
Ok Thank You,

But i have a big Problem about this.

When my website is visited from a browser or computer at the first the server will show an error:

NOT FOUND

The Server encountered an internal error or missconfiguration and was unable to complete your request


Corioosly when i visit the webpage for my browsers on my computer the website will shoen corectly without erro messages.

Who is the Problem? How can i solvent it?

Thank You


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 69 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting