| Index: trunk/extensions/ImageMap/ImageMap_body.php |
| — | — | @@ -40,6 +40,9 @@ |
| 41 | 41 | $lineNum = 0; |
| 42 | 42 | $output = ''; |
| 43 | 43 | $links = array(); |
| | 44 | + |
| | 45 | + # Define canonical desc types to allow i18n of 'imagemap_desc_types' |
| | 46 | + $descTypesCanonical = 'top-right, bottom-right, bottom-left, top-left, none'; |
| 44 | 47 | $descType = self::BOTTOM_RIGHT; |
| 45 | 48 | $defaultLinkAttribs = false; |
| 46 | 49 | $realmap = true; |
| — | — | @@ -96,10 +99,18 @@ |
| 97 | 100 | $cmd = strtok( $line, " \t" ); |
| 98 | 101 | if ( $cmd == 'desc' ) { |
| 99 | 102 | $typesText = wfMsgForContent( 'imagemap_desc_types' ); |
| | 103 | + if ( $descTypesCanonical != $typesText ) { |
| | 104 | + // i18n desc types exists |
| | 105 | + $typesText = $descTypesCanonical . ', ' . $typesText; |
| | 106 | + } |
| 100 | 107 | $types = array_map( 'trim', explode( ',', $typesText ) ); |
| 101 | 108 | $type = trim( strtok( '' ) ); |
| 102 | 109 | $descType = array_search( $type, $types ); |
| 103 | | - if ( $descType === false ) { |
| | 110 | + if ( $descType > 4 ) { |
| | 111 | + // A localized descType is used. Subtract 5 to reach the canonical desc type. |
| | 112 | + $descType = $descType - 5; |
| | 113 | + } |
| | 114 | + if ( $descType === false || $descType < 0 ) { // <0? In theory never, but paranoia... |
| 104 | 115 | return self::error( 'imagemap_invalid_desc', $typesText ); |
| 105 | 116 | } |
| 106 | 117 | continue; |
| Index: trunk/extensions/ImageMap/ImageMap.i18n.php |
| — | — | @@ -18,7 +18,7 @@ |
| 19 | 19 | 'default, rect, circle or poly', |
| 20 | 20 | 'imagemap_no_areas' => '<imagemap>: at least one area specification must be given', |
| 21 | 21 | 'imagemap_invalid_coord' => '<imagemap>: invalid coordinate at line $1, must be a number', |
| 22 | | -'imagemap_invalid_desc' => '<imagemap>: invalid desc specification, must be one of: $1', |
| | 22 | +'imagemap_invalid_desc' => '<imagemap>: invalid desc specification, must be one of: <tt>$1</tt>', |
| 23 | 23 | 'imagemap_description' => 'About this image', |
| 24 | 24 | # Note to translators: keep the same order |
| 25 | 25 | 'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| — | — | @@ -35,10 +35,10 @@ |
| 36 | 36 | '<tt>default, rect, circle</tt> oder <tt>poly</tt>', |
| 37 | 37 | 'imagemap_no_areas' => '<imagemap>-Fehler: Es muss mindestens ein Gebiet definiert werden', |
| 38 | 38 | 'imagemap_invalid_coord' => '<imagemap>-Fehler: Ungültige Koordinate in Zeile $1: es sind nur Zahlen erlaubt', |
| 39 | | -'imagemap_invalid_desc' => '<imagemap>-Fehler: Ungültiger „desc“-Parameter, möglich sind: $1', |
| | 39 | +'imagemap_invalid_desc' => '<imagemap>-Fehler: Ungültiger „desc“-Parameter, möglich sind: <tt>$1</tt>', |
| 40 | 40 | 'imagemap_description' => 'Über dieses Bild', |
| 41 | 41 | # Note to translators: keep the same order |
| 42 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| | 42 | +'imagemap_desc_types' => 'oben rechts, unten rechts, unten links, oben links, keine', |
| 43 | 43 | ), |
| 44 | 44 | |
| 45 | 45 | /* French */ |
| — | — | @@ -54,8 +54,6 @@ |
| 55 | 55 | 'imagemap_invalid_coord' => '<imagemap> : coordonnée invalide à la ligne $1, doit être un nombre', |
| 56 | 56 | 'imagemap_invalid_desc' => '<imagemap> : paramètre « desc » invalide, les paramètres possibles sont : $1', |
| 57 | 57 | 'imagemap_description' => 'À propos de cette image', |
| 58 | | -# Note to translators: keep the same order |
| 59 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 60 | 58 | ), |
| 61 | 59 | |
| 62 | 60 | |
| — | — | @@ -72,8 +70,6 @@ |
| 73 | 71 | 'imagemap_invalid_coord' => '<imagemap>: קוארדינאטה שגויה בשורה $1, היא חייבת להיות מספר', |
| 74 | 72 | 'imagemap_invalid_desc' => '<imagemap>: הגדרת פרמטר desc שגויה, צריך להיות אחד מהבאים: $1', |
| 75 | 73 | 'imagemap_description' => 'אודות התמונה', |
| 76 | | -# Note to translators: keep the same order |
| 77 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 78 | 74 | ), |
| 79 | 75 | |
| 80 | 76 | /* Indonesian (Ivan Lanin) */ |
| — | — | @@ -89,8 +85,6 @@ |
| 90 | 86 | 'imagemap_invalid_coord' => '<imagemap>: koordinat tidak sah pada baris ke $1, haruslah berupa angka', |
| 91 | 87 | 'imagemap_invalid_desc' => '<imagemap>: spesifikasi desc tidak sah, harus salah satu dari: $1', |
| 92 | 88 | 'imagemap_description' => 'Tentang gambar ini', |
| 93 | | -# Note to translators: keep the same order |
| 94 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 95 | 89 | ), |
| 96 | 90 | |
| 97 | 91 | /* Italian (AnyFile, fixed typos by BrokenArrow) */ |
| — | — | @@ -105,10 +99,6 @@ |
| 106 | 100 | 'imagemap_invalid_coord' => '<imagemap>: coordinata non valida nella riga $1, deve essere un numero', |
| 107 | 101 | 'imagemap_invalid_desc' => '<imagemap>: Valore non valido per il parametro desc, deve essere uno dei seguenti: $1', |
| 108 | 102 | 'imagemap_description' => 'Informazioni sull\'immagine', |
| 109 | | -# Note to translators: keep the same order |
| 110 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 111 | | -#Since, as far I know, the alignment indicator are kept in English in the |
| 112 | | -# image inclusion syntax, I kept them in English here too. |
| 113 | 103 | ), |
| 114 | 104 | |
| 115 | 105 | /* Kazakh default (AlefZet) */ |
| — | — | @@ -124,8 +114,6 @@ |
| 125 | 115 | 'imagemap_invalid_coord' => '<imagemap>: $1 жолында жарамсыз координата, сан болуы қажет', |
| 126 | 116 | 'imagemap_invalid_desc' => '<imagemap>: жарамсыз сипаттама маманданымы, мынаның біреуі болуы қажет: $1', |
| 127 | 117 | 'imagemap_description' => 'Бұл сурет туралы', |
| 128 | | -# Note to translators: keep the same order |
| 129 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 130 | 118 | ), |
| 131 | 119 | |
| 132 | 120 | /* Kazakh Cyrillic (AlefZet) */ |
| — | — | @@ -141,8 +129,6 @@ |
| 142 | 130 | 'imagemap_invalid_coord' => '<imagemap>: $1 жолында жарамсыз координата, сан болуы қажет', |
| 143 | 131 | 'imagemap_invalid_desc' => '<imagemap>: жарамсыз сипаттама маманданымы, мынаның біреуі болуы қажет: $1', |
| 144 | 132 | 'imagemap_description' => 'Бұл сурет туралы', |
| 145 | | -# Note to translators: keep the same order |
| 146 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 147 | 133 | ), |
| 148 | 134 | |
| 149 | 135 | /* Kazakh Latin (AlefZet) */ |
| — | — | @@ -158,8 +144,6 @@ |
| 159 | 145 | 'imagemap_invalid_coord' => '<imagemap>: $1 jolında jaramsız koordïnata, san bolwı qajet', |
| 160 | 146 | 'imagemap_invalid_desc' => '<imagemap>: jaramsız sïpattama mamandanımı, mınanıñ birewi bolwı qajet: $1', |
| 161 | 147 | 'imagemap_description' => 'Bul swret twralı', |
| 162 | | -# Note to translators: keep the same order |
| 163 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 164 | 148 | ), |
| 165 | 149 | |
| 166 | 150 | /* Kazakh Arabic (AlefZet) */ |
| — | — | @@ -175,8 +159,6 @@ |
| 176 | 160 | 'imagemap_invalid_coord' => '<imagemap>: $1 جولىندا جارامسىز كوورديناتا, سان بولۋى قاجەت', |
| 177 | 161 | 'imagemap_invalid_desc' => '<imagemap>: جارامسىز سيپاتتاما ماماندانىمى, مىنانىڭ بٴىرەۋٴى بولۋى قاجەت: $1', |
| 178 | 162 | 'imagemap_description' => 'بۇل سۋرەت تۋرالى', |
| 179 | | -# Note to translators: keep the same order |
| 180 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 181 | 163 | ), |
| 182 | 164 | |
| 183 | 165 | /* nld / Dutch (Siebrand Mazeland) */ |
| — | — | @@ -209,8 +191,6 @@ |
| 210 | 192 | 'imagemap_invalid_coord' => '<imagemap>: neplatná súradnica na riadku $1, musí to byť číslo', |
| 211 | 193 | 'imagemap_invalid_desc' => '<imagemap>: neplatný popis, musí byť jedno z nasledovných: $1', |
| 212 | 194 | 'imagemap_description' => 'O tomto obrázku', |
| 213 | | -# Note to translators: keep the same order |
| 214 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 215 | 195 | ), |
| 216 | 196 | |
| 217 | 197 | /* Chinese (China) (Shinjiman) */ |
| — | — | @@ -226,8 +206,6 @@ |
| 227 | 207 | 'imagemap_invalid_coord' => '<imagemap>: 在第$1行中有不正确的座标,它必须是一个数字', |
| 228 | 208 | 'imagemap_invalid_desc' => '<imagemap>: 不正确的 desc 参数,必须是以下的其中之一: $1', |
| 229 | 209 | 'imagemap_description' => '关于这幅图像', |
| 230 | | -# Note to translators: keep the same order |
| 231 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 232 | 210 | ), |
| 233 | 211 | |
| 234 | 212 | /* Chinese (Hong Kong) (Shinjiman) */ |
| — | — | @@ -243,8 +221,6 @@ |
| 244 | 222 | 'imagemap_invalid_coord' => '<imagemap>: 在第$1行中有不正確的座標,它必須是一個數字', |
| 245 | 223 | 'imagemap_invalid_desc' => '<imagemap>: 不正確的 desc 參數,必須是以下的其中之一: $1', |
| 246 | 224 | 'imagemap_description' => '關於這幅圖像', |
| 247 | | -# Note to translators: keep the same order |
| 248 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 249 | 225 | ), |
| 250 | 226 | |
| 251 | 227 | /* Chinese (Singapore) (Shinjiman) */ |
| — | — | @@ -260,8 +236,6 @@ |
| 261 | 237 | 'imagemap_invalid_coord' => '<imagemap>: 在第$1行中有不正确的座标,它必须是一个数字', |
| 262 | 238 | 'imagemap_invalid_desc' => '<imagemap>: 不正确的 desc 参数,必须是以下的其中之一: $1', |
| 263 | 239 | 'imagemap_description' => '关于这幅图像', |
| 264 | | -# Note to translators: keep the same order |
| 265 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 266 | 240 | ), |
| 267 | 241 | |
| 268 | 242 | /* Chinese (Taiwan) (Shinjiman) */ |
| — | — | @@ -277,8 +251,6 @@ |
| 278 | 252 | 'imagemap_invalid_coord' => '<imagemap>: 在第$1行中有不正確的座標,它必須是一個數字', |
| 279 | 253 | 'imagemap_invalid_desc' => '<imagemap>: 不正確的 desc 參數,必須是以下的其中之一: $1', |
| 280 | 254 | 'imagemap_description' => '關於這幅圖像', |
| 281 | | -# Note to translators: keep the same order |
| 282 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 283 | 255 | ), |
| 284 | 256 | |
| 285 | 257 | /* Cantonese (Shinjiman) */ |
| — | — | @@ -294,8 +266,6 @@ |
| 295 | 267 | 'imagemap_invalid_coord' => '<imagemap>: 響第$1行度有唔正確嘅座標,佢一定係一個數字', |
| 296 | 268 | 'imagemap_invalid_desc' => '<imagemap>: 唔正確嘅 desc 參數,一定係要以下嘅其中之一: $1', |
| 297 | 269 | 'imagemap_description' => '關於呢幅圖像', |
| 298 | | -# Note to translators: keep the same order |
| 299 | | -'imagemap_desc_types' => 'top-right, bottom-right, bottom-left, top-left, none', |
| 300 | 270 | ), |
| 301 | 271 | ); |
| 302 | 272 | } |