mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ImageMap
synced 2024-11-23 22:03:31 +00:00
ParsoidImageMap: use wfMessage to localize description types
* The previously failing Parsoid test now passes. Bug: T311523 Depends-On: Id7d9e82ee4ff20a79ba1a5b2433fa29bc5f76e68 Change-Id: I03115b91fd781b72f0bf2c66cb6c18963a772dab
This commit is contained in:
parent
be9aed5e13
commit
66ec96d6b1
|
@ -155,13 +155,11 @@ class ParsoidImageMap extends ExtensionTagHandler implements ExtensionModule {
|
|||
// Handle desc spec
|
||||
$cmd = strtok( $line, " \t" );
|
||||
if ( $cmd == 'desc' ) {
|
||||
$typesText = $descTypesCanonical;
|
||||
// FIXME: Support this ...
|
||||
// $typesText = wfMessage( 'imagemap_desc_types' )->inContentLanguage()->text();
|
||||
// if ( $descTypesCanonical != $typesText ) {
|
||||
// // i18n desc types exists
|
||||
// $typesText = $descTypesCanonical . ', ' . $typesText;
|
||||
// }
|
||||
$typesText = wfMessage( 'imagemap_desc_types' )->inContentLanguage()->text();
|
||||
if ( $descTypesCanonical != $typesText ) {
|
||||
// i18n desc types exists
|
||||
$typesText = $descTypesCanonical . ', ' . $typesText;
|
||||
}
|
||||
$types = array_map( 'trim', explode( ',', $typesText ) );
|
||||
$type = trim( strtok( '' ) ?: '' );
|
||||
$descType = array_search( $type, $types, true );
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
{
|
||||
"Non-default localized (French) description type": {
|
||||
"wt2html": "<p data-parsoid='{\"dsr\":[0,56,0,0]}'><span typeof=\"mw:Extension/imagemap mw:Error\" about=\"#mwt2\" data-parsoid='{\"dsr\":[0,56,10,11]}' data-mw='{\"name\":\"imagemap\",\"attrs\":{},\"body\":{\"extsrc\":\"\\nImage:Foobar.jpg\\ndesc haut-gauche\\n\"},\"errors\":[{\"key\":\"imagemap_invalid_desc\",\"params\":[\"top-right, bottom-right, bottom-left, top-left, none\"]}]}' data-mw-i18n='{\"/\":{\"lang\":\"x-user\",\"key\":\"imagemap_invalid_desc\",\"params\":[\"top-right, bottom-right, bottom-left, top-left, none\"]}}'>imagemap_invalid_desc</span></p>"
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
|
Loading…
Reference in a new issue