Korean(韓国語) support patch

  • ページ: BugTrack2
  • 投稿者: xo
  • 優先順位: 普通
  • 状態: 却下
  • カテゴリー: 本体新機能
  • 投稿日: 2005-02-22 (火) 17:43:13
  • バージョン:

NOTE

  • This Korean support supposes utf-8 converted PukiWiki.

メッセージ

This patch adds basic Korean support to version 1.4.5
Files:

--- 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 = '&#55203;';
+       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('/^([&#44032;-&#55203;])/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

 
--- 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.

 

Translated PukiWiki initial contents

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 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 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 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 2005-02-26 (土) 00:04:26
  • NOTE for me: Also investigate pukiwiki-1.4.4_php5-KO.KR-UTF8-ALPHATEST.tar! -- henoheno 2005-02-26 (土) 00:24:12

添付ファイル: fileko.lng.php.2 1303件 [詳細] fileko.lng.php 654件 [詳細] filehangul.php 1220件 [詳細] filekorean.diff 1362件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2008-10-20 (月) 18:55:56
Site admin: PukiWiki Development Team

PukiWiki 1.5.2+ © 2001-2019 PukiWiki Development Team. Powered by PHP 5.6.40-0+deb8u7. HTML convert time: 0.339 sec.

OSDN