Index: branches/nikola/phase3/languages/classes/LanguageSr.php |
— | — | @@ -151,7 +151,12 @@ |
152 | 152 | |
153 | 153 | /** |
154 | 154 | * Guess if a text is written in Cyrillic or Latin. |
| 155 | + * Overrides LanguageConverter::guessVariant() |
155 | 156 | * |
| 157 | + * @param string $text The text to be checked |
| 158 | + * @param string $variant Language code of the variant to be checked for |
| 159 | + * @return bool true if $text appears to be written in $variant |
| 160 | + * |
156 | 161 | * @author Nikola Smolenski <smolensk@eunet.rs> |
157 | 162 | * @since 1.18 |
158 | 163 | */ |
— | — | @@ -160,9 +165,9 @@ |
161 | 166 | $numLatin = preg_match_all("/[šđč枊ĐČĆŽ]/u", $text, $dummy); |
162 | 167 | |
163 | 168 | if( $variant == 'sr-ec' ) { |
164 | | - return $numCyrillic > $numLatin; |
| 169 | + return (boolean) ($numCyrillic > $numLatin); |
165 | 170 | } else if( $variant == 'sr-el' ) { |
166 | | - return $numLatin > $numCyrillic; |
| 171 | + return (boolean) ($numLatin > $numCyrillic); |
167 | 172 | } else { |
168 | 173 | return false; |
169 | 174 | } |