From 7c7dbce0f0b175b09b06301d5a71619dbdc66e57 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 13 May 2014 21:45:28 +0200 Subject: [PATCH] Remove messageTypes.inc and replace it by a hook The list is now maintained in the translatewiki repo: https://git.wikimedia.org/blob/translatewiki.git/HEAD/groups%2FMediaWiki%2FMediaWiki.yaml Change-Id: I4a33b22e425cbc1eeaf8b53870ef7b7947e91b40 --- docs/hooks.txt | 5 + maintenance/language/languages.inc | 13 +- maintenance/language/messageTypes.inc | 878 -------------------------- 3 files changed, 8 insertions(+), 888 deletions(-) delete mode 100644 maintenance/language/messageTypes.inc diff --git a/docs/hooks.txt b/docs/hooks.txt index 966afd8e8c..d1507a2e89 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1637,6 +1637,11 @@ localisation checks. &$blacklist: array of checks to blacklist. See the bottom of maintenance/language/checkLanguage.inc for the format of this variable. +'LocalisationIgnoredOptionalMessages': When fetching the list of ignored and +optional localisation messages +&$ignored Array of ignored message keys +&$optional Array of optional message keys + 'LogEventsListShowLogExtract': Called before the string is added to OutputPage. Returning false will prevent the string from being added to the OutputPage. &$s: html string to show for the log extract diff --git a/maintenance/language/languages.inc b/maintenance/language/languages.inc index 6e5b29d86d..9c9b7ff07c 100644 --- a/maintenance/language/languages.inc +++ b/maintenance/language/languages.inc @@ -61,17 +61,10 @@ class Languages { /** * Load the list of languages: all the Messages*.php * files in the languages directory. - * - * @param bool $exif Treat the Exif messages? */ - function __construct( $exif = true ) { - require __DIR__ . '/messageTypes.inc'; - $this->mIgnoredMessages = $wgIgnoredMessages; - if ( $exif ) { - $this->mOptionalMessages = array_merge( $wgOptionalMessages ); - } else { - $this->mOptionalMessages = array_merge( $wgOptionalMessages, $wgEXIFMessages ); - } + function __construct() { + wfRunHooks( 'LocalisationIgnoredOptionalMessages', + array( &$this->mIgnoredMessages, &$this->mOptionalMessages ) ); $this->mLanguages = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) ); sort( $this->mLanguages ); diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc deleted file mode 100644 index 10a3745098..0000000000 --- a/maintenance/language/messageTypes.inc +++ /dev/null @@ -1,878 +0,0 @@ -