Changeset 1099 in svn for trunk


Ignore:
Timestamp:
2012-08-01T08:47:18+02:00 (3 years ago)
Author:
Xuefer
Message:

refactor: move lang files to sub folder

Location:
trunk/htdocs
Files:
7 added
6 edited
8 moved

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/cacher/common.php

    r1078 r1099  
    33require_once "../common/common.php";
    44
    5 include get_language_file("cacher");
     5include get_language_file("./lang");
     6$module = "cacher";
     7
  • trunk/htdocs/cacher/edit.php

    r1078 r1099  
    3737}
    3838
    39 $module = "cacher";
    40 
    4139include "edit.tpl.php";
    4240
  • trunk/htdocs/cacher/index.php

    r1090 r1099  
    254254// }}}
    255255
    256 $module = "cacher";
    257256xcache_count(XC_TYPE_PHP); // trigger auth
    258257if (!extension_loaded('XCache')) {
  • trunk/htdocs/common/common.php

    r1090 r1099  
    8686}
    8787
    88 function get_language_file_ex($name, $lang)
     88function get_language_file_ex($dir, $lang)
    8989{
    9090    static $langMap = array(
     
    101101    }
    102102
    103     $file = "$name-$lang.lang.php";
     103    $file = "$dir/$lang.php";
    104104    if (file_exists($file)) {
    105105        return $file;
     
    108108}
    109109
    110 function get_language_file($name)
     110function get_language_file($dir)
    111111{
    112112    global $config;
    113113    if (!empty($config['lang'])) {
    114114        $lang = strtolower($config['lang']);
    115         $file = get_language_file_ex($name, $lang);
     115        $file = get_language_file_ex($dir, $lang);
    116116        if (!isset($file)) {
    117117            $lang = strtok($lang, ':-');
    118             $file = get_language_file_ex($name, $lang);
     118            $file = get_language_file_ex($dir, $lang);
    119119        }
    120120    }
     
    125125            foreach (explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $lang) {
    126126                $lang = strtok($lang, ':;');
    127                 $file = get_language_file_ex($name, $lang);
     127                $file = get_language_file_ex($dir, $lang);
    128128                if (isset($file)) {
    129129                    $config['lang'] = $lang;
     
    131131                }
    132132                if (strpos($lang, '-') !== false) {
    133                     $file = get_language_file_ex($name, strtok($lang, ':-'));
     133                    $file = get_language_file_ex($dir, strtok($lang, ':-'));
    134134                    if (isset($file)) {
    135135                        $config['lang'] = $lang;
     
    140140        }
    141141    }
    142     return isset($file) ? $file : "$name-en.lang.php";
     142    return isset($file) ? $file : "$dir/en.php";
    143143}
    144144
     
    261261
    262262$strings = array();
    263 include get_language_file("../common/common");
     263include get_language_file("../common/lang");
    264264
    265265$modules = array();
  • trunk/htdocs/coverager/common.php

    r1077 r1099  
    33require_once "../common/common.php";
    44
    5 include get_language_file("coverager");
     5include get_language_file("./lang");
    66$module = "coverager";
    77
  • trunk/htdocs/diagnosis/index.php

    r1093 r1099  
    22
    33include "../common/common.php";
     4include get_language_file("./lang");
     5
    46$knownUnstablePhpVersions = array(
    57        array('=', '5.3.14', 'random corrupt memory on high concurrent'),
Note: See TracChangeset for help on using the changeset viewer.