+ /**
+ * Extract custom captions from search-interwiki-custom message
+ */
+ protected function getCustomCaptions() {
+ if ( is_null( $this->customCaptions ) ) {
+ $this->customCaptions = array();
+ // format per line <iwprefix>:<caption>
+ $customLines = explode( "\n", $this->msg( 'search-interwiki-custom' )->text() );
+ foreach ( $customLines as $line ) {
+ $parts = explode( ":", $line, 2 );
+ if ( count( $parts ) == 2 ) { // validate line
+ $this->customCaptions[$parts[0]] = $parts[1];
+ }
+ }
+ }
+ }
+