From: Brion Vibber Date: Mon, 19 May 2008 20:20:33 +0000 (+0000) Subject: * (bug 1701) Korean Hangul syllables now broken down properly in Category lists even... X-Git-Tag: 1.31.0-rc.0~47539 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=3dda804bd658091b89be8bd58e6d179637f764e3;p=lhc%2Fweb%2Fwiklou.git * (bug 1701) Korean Hangul syllables now broken down properly in Category lists even if the wiki's overall content language is not Korean Nothing else left in LanguageKo class, so ditching it. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9ebf32c470..ed6494279e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -280,7 +280,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14111) Similar filename warning links now lead to correct page * (bug 14082) Fix for complex text input vs AJAX suggestions on some browsers * (bug 13693) Categories sometimes claim to have a negative number of members - +* (bug 1701) Korean Hangul syllables now broken down properly in Category lists + even if the wiki's overall content language is not Korean === API changes in 1.13 === diff --git a/languages/Language.php b/languages/Language.php index b8d2aecd8e..c9b35f628b 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1464,7 +1464,47 @@ class Language { preg_match( '/^([\x00-\x7f]|[\xc0-\xdf][\x80-\xbf]|' . '[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xf7][\x80-\xbf]{3})/', $s, $matches); - return isset( $matches[1] ) ? $matches[1] : ""; + if ( isset( $matches[1] ) ) { + if ( strlen( $matches[1] ) != 3 ) { + return $matches[1]; + } + + // Break down Hangul syllables to grab the first jamo + $code = utf8ToCodepoint( $matches[1] ); + if ( $code < 0xac00 || 0xd7a4 <= $code) { + return $matches[1]; + } elseif ( $code < 0xb098 ) { + return "\xe3\x84\xb1"; + } elseif ( $code < 0xb2e4 ) { + return "\xe3\x84\xb4"; + } elseif ( $code < 0xb77c ) { + return "\xe3\x84\xb7"; + } elseif ( $code < 0xb9c8 ) { + return "\xe3\x84\xb9"; + } elseif ( $code < 0xbc14 ) { + return "\xe3\x85\x81"; + } elseif ( $code < 0xc0ac ) { + return "\xe3\x85\x82"; + } elseif ( $code < 0xc544 ) { + return "\xe3\x85\x85"; + } elseif ( $code < 0xc790 ) { + return "\xe3\x85\x87"; + } elseif ( $code < 0xcc28 ) { + return "\xe3\x85\x88"; + } elseif ( $code < 0xce74 ) { + return "\xe3\x85\x8a"; + } elseif ( $code < 0xd0c0 ) { + return "\xe3\x85\x8b"; + } elseif ( $code < 0xd30c ) { + return "\xe3\x85\x8c"; + } elseif ( $code < 0xd558 ) { + return "\xe3\x85\x8d"; + } else { + return "\xe3\x85\x8e"; + } + } else { + return ""; + } } function initEncoding() { diff --git a/languages/classes/LanguageKo.php b/languages/classes/LanguageKo.php deleted file mode 100644 index 4856edccca..0000000000 --- a/languages/classes/LanguageKo.php +++ /dev/null @@ -1,55 +0,0 @@ -