From b8cfcd0656712d5a8dce5bf80691b2f47ab98ef8 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 27 Dec 2009 14:59:27 +0000 Subject: [PATCH] Added --prefix option to maintenance/language/checkLanguage.php to add interwiki prefix to links (when using --links option) --- maintenance/language/checkLanguage.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 30f69a22ef..022f8ce92d 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -7,6 +7,7 @@ class CheckLanguageCLI { protected $code = null; protected $level = 2; protected $doLinks = false; + protected $linksPrefix = ''; protected $wikiCode = 'en'; protected $checkAll = false; protected $output = 'plain'; @@ -42,6 +43,10 @@ class CheckLanguageCLI { $this->includeExif = !isset( $options['noexif'] ); $this->checkAll = isset( $options['all'] ); + if ( isset( $options['prefix'] ) ) { + $this->linksPrefix = $options['prefix']; + } + if ( isset( $options['wikilang'] ) ) { $this->wikiCode = $options['wikilang']; } @@ -190,6 +195,7 @@ Parameters: * help: Show this help. * level: Show the following display level (default: 2). * links: Link the message values (default off). + * prefix: prefix to add to links. * wikilang: For the links, what is the content language of the wiki to display the output in (default en). * whitelist: Do only the following checks (form: code,code). * blacklist: Don't do the following checks (form: code,code). @@ -316,9 +322,9 @@ ENDS; if ( $this->doLinks ) { $displayKey = ucfirst( $key ); if ( $code == $this->wikiCode ) { - return "[[MediaWiki:$displayKey|$key]]"; + return "[[{$this->linksPrefix}MediaWiki:$displayKey|$key]]"; } else { - return "[[MediaWiki:$displayKey/$code|$key]]"; + return "[[{$this->linksPrefix}MediaWiki:$displayKey/$code|$key]]"; } } else { return $key; -- 2.20.1