r85239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85238‎ | r85239 | r85240 >
Date:10:27, 3 April 2011
Author:nikola
Status:ok
Tags:
Comment:
Minor fixes
Modified paths:
  • /branches/nikola/phase3/languages/LanguageConverter.php (modified) (history)
  • /branches/nikola/phase3/languages/classes/LanguageSr.php (modified) (history)

Diff [purge]

Index: branches/nikola/phase3/languages/LanguageConverter.php
@@ -780,8 +780,9 @@
781781 * @return bool true if $text appears to be written in $variant, false if not
782782 *
783783 * @author Nikola Smolenski <smolensk@eunet.yu>
 784+ * @since 1.17
784785 */
785 - function guessVariant($text, $variant) {
 786+ public function guessVariant($text, $variant) {
786787 return false;
787788 }
788789
Index: branches/nikola/phase3/languages/classes/LanguageSr.php
@@ -153,10 +153,11 @@
154154 * Guess if a text is written in Cyrillic or Latin.
155155 *
156156 * @author Nikola Smolenski <smolensk@eunet.rs>
 157+ * @since 1.17
157158 */
158 - function guessVariant( $text, $variant ) {
159 - $numCyrillic = preg_match_all("/(ш|ђ|ч|ћ|ж|Ш|Ђ|Ч|Ћ|Ж)/", $text, $dummy);
160 - $numLatin = preg_match_all("/(š|đ|č|ć|ž|Š|Đ|Č|Ć|Ž)/", $text, $dummy);
 159+ public function guessVariant( $text, $variant ) {
 160+ $numCyrillic = preg_match_all("/[шђчћжШЂЧЋЖ]/u", $text, $dummy);
 161+ $numLatin = preg_match_all("/[šđč枊ĐČĆŽ]/u", $text, $dummy);
161162
162163 if( $variant == 'sr-ec' ) {
163164 return $numCyrillic > $numLatin;

Follow-up revisions

RevisionCommit summaryAuthorDate
r86623(bug 28643) Merge Serbian language variant conversion improvements to trunk (...demon14:02, 21 April 2011
r103327bug 28643 improvement to serbian variants conversion...hashar15:12, 16 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85224Don't convert text to a variant, if it is already written in that variant (to...nikola02:25, 3 April 2011

Status & tagging log