source: branches/comu-utf8/data/conf/i18n.php @ 16208

Revision 16208, 981 bytes checked in by adachi, 14 years ago (diff)

fixed diefined(DATA_PATH) => defined('DATA_PATH')

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2if (defined('DATA_PATH')) {
3    define('LOCALE_DIR', DATA_PATH . 'locale/');
4
5    $accept_language = '';
6    if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
7        $accept_language = array_shift(split(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']));
8    }
9    switch ($accept_language) {
10    case 'ja':
11        $language = 'ja';
12        break;
13    case 'ko':
14    case 'ko-kr':
15        $language = 'ko';
16        break;
17    case 'en':
18    case 'en-us':
19    default:
20        $language = 'en';
21        break;
22    }
23    $text = file_get_contents(LOCALE_DIR . $language . '.html');
24    $preVar = explode('<!--end-->', $text);
25    foreach ($preVar AS $preVar_1) {
26        $preVar_2 = explode('-->', $preVar_1);
27        $preVar_3 = explode('<!--', $preVar_2[0]);
28        $newVar = str_replace(' ', '_', $preVar_3[1]);
29        #$_GLOBALS['_lang'][$newVar] = $preVar_2[1];
30        define('_lang_' . $newVar, $preVar_2[1]);
31    }
32    #var_dump($accept_language);
33    #var_dump($language);
34}
35?>
Note: See TracBrowser for help on using the repository browser.