Changeset 9520


Ignore:
Timestamp:
03/04/11 12:35:38 (9 years ago)
Author:
patdenice
Message:

feature:2210
Update language from piwigo.org extension repository

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/languages.class.php

    r9518 r9520  
    3333  function languages($target_charset = null) 
    3434  { 
    35     $this->fs_languages = $this->get_fs_languages($target_charset); 
     35    $this->get_fs_languages($target_charset); 
    3636  } 
    3737 
     
    4848    $tabsheet = new tabsheet(); 
    4949    $tabsheet->add('languages_installed', l10n('Installed Languages'), $link.'languages_installed'); 
     50    $tabsheet->add('languages_update', l10n('Check for updates'), $link.'languages_update'); 
    5051    $tabsheet->add('languages_new', l10n('Add New Language'), $link.'languages_new'); 
    5152    $tabsheet->select($selected); 
     
    171172        { 
    172173          $language = array( 
     174              'name'=>$file, 
    173175              'code'=>$file, 
    174176              'version'=>'0', 
     
    212214    closedir($dir); 
    213215    @uasort($this->fs_languages, 'name_compare'); 
    214  
    215     return $this->fs_languages; 
    216216  } 
    217217 
     
    283283      'version' => implode(',', $versions_to_check), 
    284284      'lang' => $user['language'], 
     285      'get_nb_downloads' => 'true', 
    285286      ) 
    286287    ); 
     
    308309        if (preg_match('/^.*? \[[A-Z]{2}\]$/', $language['extension_name'])) 
    309310        { 
    310           $this->server_languages[$language['extension_name']] = $language; 
    311         } 
    312       } 
    313       @ksort($this->server_languages); 
     311          $this->server_languages[$language['extension_id']] = $language; 
     312        } 
     313      } 
     314      @uasort($this->server_languages, array($this, 'extension_name_compare')); 
    314315      return true; 
    315316    } 
     
    379380                if ($status == 'ok') 
    380381                { 
    381                   $this->fs_languages = $this->get_fs_languages(); 
    382                   $this->perform_action('activate', $dest); 
     382                  $this->get_fs_languages(); 
     383                  if ($action == 'install') 
     384                  { 
     385                    $this->perform_action('activate', $dest); 
     386                  } 
    383387                } 
    384388                if (file_exists($extract_path.'/obsolete.list') 
     
    472476    } 
    473477  } 
     478 
     479  /** 
     480   * Sort functions 
     481   */ 
     482  function language_version_compare($a, $b) 
     483  { 
     484    $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./'); 
     485    $replacement = array( "'.'.intval('\\1', 36).'.'", '.', ''); 
     486 
     487    $array = preg_replace($pattern, $replacement, array($a, $b)); 
     488 
     489    return version_compare($array[0], $array[1], '>='); 
     490  } 
     491 
     492  function extension_name_compare($a, $b) 
     493  { 
     494    return strcmp(strtolower($a['extension_name']), strtolower($b['extension_name'])); 
     495  } 
    474496} 
    475497?> 
  • trunk/install.php

    r9518 r9520  
    341341 
    342342    // fill languages table 
    343     foreach ($languages->get_fs_languages() as $language_code => $fs_language) 
     343    foreach ($languages->fs_languages as $language_code => $fs_language) 
    344344    { 
    345345      $languages->perform_action('activate', $language_code); 
  • trunk/language/en_UK/admin.lang.php

    r9494 r9520  
    771771$lang['[Simulation]'] = "[Simulation]"; 
    772772$lang['Themes which need upgrade'] = 'Themes which need upgrade'; 
     773$lang['Languages which need upgrade'] = 'Languages which need upgrade'; 
    773774$lang['All themes are up to date.'] = 'All themes are up to date.'; 
    774775$lang['All plugins are up to date.'] = 'All plugins are up to date.'; 
     776$lang['All languages are up to date.'] = 'All languages are up to date.'; 
    775777$lang['Visit theme site'] = 'Visit theme site'; 
    776778$lang['New Version'] = 'New Version'; 
  • trunk/language/fr_FR/admin.lang.php

    r9494 r9520  
    782782$lang['Remove from caddie'] = 'Retirer du panier'; 
    783783$lang['Themes which need upgrade'] = 'Thèmes à mettre à jour'; 
     784$lang['Languages which need upgrade'] = 'Langues à mettre à jour'; 
    784785$lang['All themes are up to date.'] = 'Tous les thèmes sont à jour.'; 
    785786$lang['All plugins are up to date.'] = 'Tous les plugins sont à jour.'; 
     787$lang['All languages are up to date.'] = 'Toutes les langues sont à jour.'; 
    786788$lang['Visit theme site'] = 'Visitez le site du thème'; 
    787789$lang['New Version'] = 'Nouvelle version'; 
Note: See TracChangeset for help on using the changeset viewer.