Index: trunk/phase3/languages/LanguageConverter.php |
— | — | @@ -199,24 +199,6 @@ |
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |
203 | | - * caption convert, base on preg_replace |
204 | | - * |
205 | | - * to convert text in "title" or "alt", like '<img alt="text" ... ' |
206 | | - * or '<span title="text" ... ' |
207 | | - * |
208 | | - * @param string $title the "title" or "alt" text |
209 | | - * @param string $text the text to be converted |
210 | | - * @param string $toVariant the target language code |
211 | | - * @return string like ' alt="yyyy"' or ' title="yyyy"' |
212 | | - */ |
213 | | - protected function captionConvert( $title, $text, $toVariant ) { |
214 | | - // we convert captions except URL |
215 | | - if( !strpos( $text, '://' ) ) |
216 | | - $text = $this->translate($text, $toVariant); |
217 | | - return " $title=\"$text\""; |
218 | | - } |
219 | | - |
220 | | - /** |
221 | 203 | * dictionary-based conversion |
222 | 204 | * |
223 | 205 | * @param string $text the text to be converted |
— | — | @@ -266,14 +248,8 @@ |
267 | 249 | |
268 | 250 | $ret = $this->translate($m[0], $toVariant); |
269 | 251 | $mstart = $m[1]+strlen($m[0]); |
270 | | - |
271 | | - // enable convertsion of '<img alt="xxxx" ... ' or '<span title="xxxx" ... ' |
272 | | - $captionpattern = '/\s(title|alt)\s*=\s*"([\s\S]*?)"/e'; |
273 | | - $replacement = "\$this->captionConvert('\\1', '\\2', \$toVariant)"; |
274 | 252 | foreach($matches as $m) { |
275 | | - $mark = substr($text, $mstart, $m[1]-$mstart); |
276 | | - $mark = preg_replace($captionpattern, $replacement, $mark); |
277 | | - $ret .= $mark; |
| 253 | + $ret .= substr($text, $mstart, $m[1]-$mstart); |
278 | 254 | $ret .= $this->translate($m[0], $toVariant); |
279 | 255 | $mstart = $m[1] + strlen($m[0]); |
280 | 256 | } |