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

Revision 15112, 829 bytes checked in by Yammy, 14 years ago (diff)

defaultの言語をenへ

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