Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -322,11 +322,6 @@ |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | | - if( $this->guessVariant( $text, $toVariant ) ) { |
327 | | - wfProfileOut( __METHOD__ ); |
328 | | - return $text; |
329 | | - } |
330 | | - |
331 | 326 | /* we convert everything except: |
332 | 327 | 1. HTML markups (anything between < and >) |
333 | 328 | 2. HTML entities |
— | — | @@ -576,7 +571,7 @@ |
577 | 572 | */ |
578 | 573 | public function convertTo( $text, $variant ) { |
579 | 574 | global $wgDisableLangConversion; |
580 | | - if ( $wgDisableLangConversion || $this->guessVariant( $text, $variant ) ) { |
| 575 | + if ( $wgDisableLangConversion ) { |
581 | 576 | return $text; |
582 | 577 | } |
583 | 578 | return $this->recursiveConvertTopLevel( $text, $variant ); |
— | — | @@ -778,20 +773,6 @@ |
779 | 774 | } |
780 | 775 | |
781 | 776 | /** |
782 | | - * Guess if a text is written in a variant. This should be implemented in subclasses. |
783 | | - * |
784 | | - * @param string $text the text to be checked |
785 | | - * @param string $variant language code of the variant to be checked for |
786 | | - * @return bool true if $text appears to be written in $variant, false if not |
787 | | - * |
788 | | - * @author Nikola Smolenski <smolensk@eunet.rs> |
789 | | - * @since 1.18 |
790 | | - */ |
791 | | - public function guessVariant($text, $variant) { |
792 | | - return false; |
793 | | - } |
794 | | - |
795 | | - /** |
796 | 777 | * Load default conversion tables. |
797 | 778 | * This method must be implemented in derived class. |
798 | 779 | * |
Index: trunk/phase3/languages/classes/LanguageSr.php |
— | — | @@ -173,30 +173,6 @@ |
174 | 174 | |
175 | 175 | return $ret; |
176 | 176 | } |
177 | | - |
178 | | - /** |
179 | | - * Guess if a text is written in Cyrillic or Latin. |
180 | | - * |
181 | | - * @author Nikola Smolenski <smolensk@eunet.rs> |
182 | | - * @since 1.18 |
183 | | - * |
184 | | - * @param $text string |
185 | | - * @param $variant string |
186 | | - * |
187 | | - * @return bool |
188 | | - */ |
189 | | - public function guessVariant( $text, $variant ) { |
190 | | - $numCyrillic = preg_match_all("/[шђчћжШЂЧЋЖ]/u", $text, $dummy); |
191 | | - $numLatin = preg_match_all("/[šđč枊ĐČĆŽ]/u", $text, $dummy); |
192 | | - |
193 | | - if( $variant == 'sr-ec' ) { |
194 | | - return $numCyrillic > $numLatin; |
195 | | - } elseif( $variant == 'sr-el' ) { |
196 | | - return $numLatin > $numCyrillic; |
197 | | - } else { |
198 | | - return false; |
199 | | - } |
200 | | - } |
201 | 177 | } |
202 | 178 | |
203 | 179 | /** |
— | — | @@ -257,5 +233,4 @@ |
258 | 234 | } |
259 | 235 | } |
260 | 236 | } |
261 | | - |
262 | 237 | } |