Index: trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php |
— | — | @@ -264,7 +264,9 @@ |
265 | 265 | $html = str_replace( $matches[ 0 ][ $i ], wfMsg( $msg_key, $params ), $html ); |
266 | 266 | } else { |
267 | 267 | // look for a country variant of the message and use that if found |
268 | | - $html = str_replace( '%' . $msg_key . '%', $this->get_message_variation( $msg_key ), $html ); |
| 268 | + $msg_text = DataValidator::wfLangSpecificFallback( $this->getEscapedValue( 'language' ), |
| 269 | + array( $msg_key . '-' . strtolower( $this->getEscapedValue( 'country' ) ), $msg_key ) ); |
| 270 | + $html = str_replace( '%' . $msg_key . '%', $msg_text, $html ); |
269 | 271 | } |
270 | 272 | } |
271 | 273 | |
— | — | @@ -443,53 +445,6 @@ |
444 | 446 | } |
445 | 447 | |
446 | 448 | /** |
447 | | - * This function looks for a country variant of the specified message and |
448 | | - * returns the variant if found for the current language. If the variant |
449 | | - * does not have a message for the current language, the original message |
450 | | - * is used (checking first the current language and then falling back as |
451 | | - * is normal for wfMessage). |
452 | | - * |
453 | | - * @param $key The original message key to be evaluated |
454 | | - * @return string A string representing the message requested |
455 | | - */ |
456 | | - function get_message_variation( $key ) { |
457 | | - $langCode = strtolower( $this->getEscapedValue( 'language' ) ); |
458 | | - $countryCode = strtolower( $this->getEscapedValue( 'country' ) ); |
459 | | - |
460 | | - # construct the country-specific message key |
461 | | - $msg_alt_key = $key . '-' . $countryCode; |
462 | | - $msg_alt = wfMessage( $msg_alt_key ); |
463 | | - |
464 | | - # load the default |
465 | | - $to_return = wfMessage( $key )->inLanguage( $langCode )->text(); |
466 | | - |
467 | | - # check to see if an alternate exists |
468 | | - if ( $msg_alt->exists() ){ |
469 | | - # get the English version of the alternate message |
470 | | - $msg_alt_en = $msg_alt->inLanguage( 'en' )->text(); |
471 | | - # get the alternate message in the current language |
472 | | - $msg_alt_lang = $msg_alt->inLanguage( $langCode )->text(); |
473 | | - |
474 | | - # if we are looking for English, we're good |
475 | | - if ( $langCode == 'en' ){ |
476 | | - $to_return = $msg_alt_en; |
477 | | - } |
478 | | - # check make sure we didn't fallback to English |
479 | | - elseif ( strcmp( $msg_alt_en, $msg_alt_lang ) != 0 ){ |
480 | | - $to_return = $msg_alt_lang; |
481 | | - } |
482 | | - else { |
483 | | - # do nothing and return the original message |
484 | | - } |
485 | | - } |
486 | | - |
487 | | - # strip the damned colons off of the right end |
488 | | - $to_return = rtrim( $to_return, ':' ); |
489 | | - |
490 | | - return $to_return; |
491 | | - } |
492 | | - |
493 | | - /** |
494 | 449 | * Gets a list of the supported countries from the parent class |
495 | 450 | * and returns an option list representing all of those countries |
496 | 451 | * in a translatable fashion. |