RIGHT:&size(12){Category: [[:Internationalization]]}; *Korean(韓国語) support patch [#sc64ca8e] -ページ: [[BugTrack2]] -投稿者: [[xo]] -優先順位: 普通 -状態: 却下 -カテゴリー: 本体新機能 -投稿日: 2005-02-22 (火) 17:43:13 -バージョン: ** NOTE [#m263cc99] - This Korean support supposes utf-8 converted PukiWiki. **メッセージ [#ga7e6bc8] This patch adds basic Korean support to version 1.4.5~ Files: #ref(korean.diff) #ref(hangul.php) #ref(ko.lng.php.2) --- pukiwiki.ini.php.bak Mon Feb 7 22:22:40 2005 +++ pukiwiki.ini.php Tue Feb 22 17:11:44 2005 @@ -33,7 +33,7 @@ ///////////////////////////////////////////////// // Language / Encoding settings -// LANG - Internal content encoding ('en', 'ja', or ...) +// LANG - Internal content encoding ('en', 'ja', 'ko', or ...) define('LANG', 'ja'); // UI_LANG - Content Language for buttons, menus, etc @@ -75,6 +75,10 @@ switch (LANG) { // or specifiy one case 'ja': define('ZONE', 'JST'); + define('ZONETIME', 9 * 3600); // JST = GMT + 9 + break; +case 'ko': + define('ZONE', 'KST'); define('ZONETIME', 9 * 3600); // JST = GMT + 9 break; default : --- orig/lib/init.php Tue Feb 22 02:25:59 2005 +++ lib/init.php Tue Feb 22 09:31:39 2005 @@ -68,6 +68,11 @@ define('MB_LANGUAGE', 'Japanese'); define('SOURCE_ENCODING', 'EUC-JP'); break; +case 'ko': // UTF-8 + define('CONTENT_CHARSET', 'UTF-8'); + define('MB_LANGUAGE', 'Korean'); + define('SOURCE_ENCODING', 'UTF-8'); + break; default: --- orig/lib/pukiwiki.php Sun Oct 10 21:58:30 2004 +++ lib/pukiwiki.php Tue Feb 22 15:18:58 2005 @@ -67,6 +67,8 @@ // 初期化: 設定ファイルの読み込み require(LIB_DIR . 'init.php'); +if (LANG == 'ko') require(LIB_DIR . 'hangul.php'); + ///////////////////////////////////////////////// // Main --- orig/lib/func.utf8.php Tue Feb 22 13:12:13 2005 +++ lib/func.php Tue Feb 22 12:25:35 2005 @@ -275,7 +275,10 @@ // ソートキーを決定する。 ' ' < '[a-zA-Z]' < 'zz'という前提。 $symbol = ' '; - $other = 'zz'; + if (LANG == 'ko') + $other = '힣'; + else + $other = 'zz'; $retval = ''; @@ -313,8 +316,14 @@ $head = $other; } } else { - $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : - (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other); + if (LANG == 'ko') + $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : + (preg_match('/^([ -~])/', $page, $matches) ? $symbol : + (preg_match('/^([가-힣])/u', $page, $matches)) ? hangul_chosung($page) : + $other); + else + $head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] : + (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other); } $list[$head][$page] = $str; Note, 가 and 힣 is UTF-8 character of html entity number 44032 and 55203~ #br --- orig/lib/trackback.php Sat Jan 29 22:53:37 2005 +++ lib/trackback.php Tue Feb 22 13:16:48 2005 @@ -112,6 +112,11 @@ 'charset' => SOURCE_ENCODING // Ping text encoding (Not defined) ); + if (LANG == 'ko') { + mb_convert_variables('EUC-KR', SOURCE_ENCODING, $putdata); + $putdata['charset'] = 'EUC-KR'; + } + foreach ($links as $link) { $tb_id = tb_get_url($link); // Get Trackback ID from the URL if (empty($tb_id)) continue; // Trackback is not supported Majority of Korean blogs use EUC-KR and some of them does not converts UTF-8 TrackBack Pings to EUC-KR(which results garbages in TrackBack), but most UTF-8 blogs understands EUC-KR Ping, so we should send it in EUC-KR.~ #br ** Translated PukiWiki initial contents [#yecfde61] You can get translated WikiSeed from PukiWikiKr.~ 번역된 위키시드(문법등)가 필요한 한국분은 PukiWikiKr [[홈페이지>http://kldp.net/projects/pukiwikikr]]에서 얻으실 수 있습니다. ---- -Oh, I'm waiting for this situation ;) Let me investigate this. -- [[henoheno]] &new{2005-02-22 (火) 22:14:13}; -Hmm... I guess "WikiSeed" means "Initial content for Wiki" in Korea(?). I'm just looking at moniwiki's directory structure and found a directory "wikiseed" including Wiki page datas. -- [[henoheno]] &new{2005-02-25 (金) 23:53:32}; -- Hmm... I'm just looking pukiwiki-1.4.4_php5-KO.KR-UTF8-ALPHATEST.tar/wiki. It's no wander, this is Korean-translated contents (UTF-8) :) ... I can't read them though (^^; -- [[henoheno]] &new{2005-02-25 (金) 23:59:27}; -- You know, PukiWiki sources in cvs repository is not UTF-8 but EUC-JP(or ASCII) now, and I think this is only-one solution of closs-platform(Windows, Linux, FreeBSD ...) cvs development environment in Japan now. It's classical way but works well. And I also understand UTF-8 is needed in this Korean version. So I'll commit pukiwiki/wiki.ko data as-is(UTF-8). = Take care not converting wiki.kr directory from EUC-JP to UTF-8. -- [[henoheno]] &new{2005-02-26 (土) 00:04:26}; -NOTE for me: Also investigate pukiwiki-1.4.4_php5-KO.KR-UTF8-ALPHATEST.tar! -- [[henoheno]] &new{2005-02-26 (土) 00:24:12};