Changeset 874


Ignore:
Timestamp:
03/15/06 13:34:20 (7 years ago)
Author:
benjamin
Message:

Adding source flags + correcting ticket #546 about fr_CA and other locales problems

Location:
trunk/bureau
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bureau/admin/index.php

    r868 r874  
    6868<?php  
    6969foreach($locales as $l) { 
     70if (file_exists("../".$l.".png")) { 
    7071?> 
    7172 <a href="?setlang=<?php echo $l; ?>"><img src="../<?php echo $l; ?>.png" alt="<?php __($l); ?>" title="<?php __($l); ?>" /></a> 
    7273&nbsp;&nbsp; 
    73      <?php } ?> 
     74     <?php } } ?> 
    7475</td> 
    7576<td style="text-align: right"> 
  • trunk/bureau/class/lang_env.php

    r872 r874  
    2020  $lang=$_REQUEST["setlang"]; 
    2121} 
    22 // default language (can be changed here) 
    23 $language="fr_FR"; 
    2422 
    2523$locales=array("fr_FR"=>"fr_FR","en_US"=>"en_US"); 
     
    3129} 
    3230 
     31 
    3332if (!$locales[$lang]) { // Requested language not found in locales 
    3433  // treat special cases such as en_AU or fr_BF : use the language only, not the country. 
     
    3635  foreach($locales as $l) { 
    3736    if (substr($l,0,2)==$ll) { 
    38       $language=$l; 
     37      $lang=$l; 
    3938      break; 
    4039    } 
     
    4241} 
    4342 
    44 if ($setlang && $language) { 
     43if (!$locales[$lang]) $lang=$locales[0];  
     44 
     45if ($setlang && $lang) { 
    4546  setcookie("lang",$lang); 
    4647} 
    4748 
    4849// User chose a non existent language, select the first available one  
    49 if (!$locales[$lang]) $lang=$locales[0];  
     50 
    5051 
    5152/* Language ok, set the locale environment */ 
    52 putenv("LC_MESSAGES=$language"); 
    53 putenv("LANG=$language"); 
    54 putenv("LANGUAGE=$language"); 
     53putenv("LC_MESSAGES=$lang"); 
     54putenv("LANG=$lang"); 
     55putenv("LANGUAGE=$lang"); 
    5556// this locale MUST be selected in "dpkg-reconfigure locales" 
    56 setlocale(LC_ALL,$language);  
     57setlocale(LC_ALL,$lang);  
    5758textdomain("alternc"); 
    5859 
Note: See TracChangeset for help on using the changeset viewer.