wiki.techinc.nl/docs
Niklas Laxström a064f78053 New hook MessageCache::get
Example usage:

$wgHooks['MessageCache::get'][] = function( &$key ) {
	static $keys = null;
	if ( $keys === null ) {
		global $wgExtensionMessagesFiles;
		require( $wgExtensionMessagesFiles['OverrideMessages'] );
		$keys = array_flip( array_keys( $messages['en'] ) );
	}

	if ( isset( $keys["myprefix-$key"] ) ) {
		$key = "myprefix-$key";
	}

	return true;
}

Pros:
* Easy way to override standard core and extension messages without
  any changes to them
* Messages can be stored in a standard i18n file
* Messages can be translated easily with Translate
* Messages can be shared accross multiple wikis easily
* Takes advantage of the normal message cache behavior unlike the
  MessagePreLoad hook
* Missing translations fallback to the override, not to the
  uncustomized standard translation
* Do not need to handle conflicting message keys at translatewiki.net
  if adopted by WMF

Cons:
* This method is called often, so there will be small performance
  impact if no hooks are registered. Impact can be big if the
  implementation of hook subscriber is inefficient.

This can help with bugs like 36149. It doesn't remove the manual work
needed to detect those messages and adding them to the i18n file.

I have been using this patch in a wiki farm for months.

Change-Id: Ib39937a440e71ae7292cf992ab37a569189741e4
2014-02-10 15:51:52 +00:00
..
code-coverage Tests aren't in /maintenance anymore! ;) 2012-04-15 19:21:12 +01:00
databases Remove DB2 support 2013-02-25 13:47:03 -08:00
html .gitignore for generated html doc 2012-03-31 20:17:34 +02:00
php-memcached phpcs: More require/include is not a function 2013-05-21 23:26:28 +02:00
uidesign Drop redundant attributes in hardcoded html 2013-05-21 01:05:12 +02:00
contenthandler.txt Fix typo in contenthandler documentation 2012-10-16 10:36:56 +00:00
database.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
deferred.txt
design.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
distributors.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
doxygen_first_page.php Link to mediawiki.org using https from doxygen first page, not http 2012-09-11 21:43:29 +02:00
export-0.1.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.2.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.3.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.4.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.5.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.6.xsd Fix trailing whitespace (and mixed spaces) in XSD files 2012-05-27 14:03:29 +01:00
export-0.7.xsd xsd: fix id within contributor to allow 0 2012-06-27 11:31:41 +02:00
export-0.8.xsd Fix escaping of pattern in export-0.8.xsd 2012-11-03 19:38:58 +01:00
export-demo.xml update export-demo.xml to version-0.8.xsd 2012-11-03 19:37:02 +01:00
globals.txt Moving check higher up in case there's a premade toggle _but_ no .wm-collapsible-content premade. This way the link will be caught before it's inner-wrapped, after which it would no longer be a direct child. 2011-05-23 19:08:26 +00:00
hooks.txt New hook MessageCache::get 2014-02-10 15:51:52 +00:00
language.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
linkcache.txt
magicword.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
maintenance.txt Clean up some old readme files and remove references to SVN 2013-11-16 10:38:50 +00:00
memcached.txt Revert "DifferenceEngine cleanup" 2013-11-11 16:35:19 +00:00
README Clean up some old readme files and remove references to SVN 2013-11-16 10:38:50 +00:00
schema.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
scripts.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
skin.txt http://www.mediawiki.org --> https://www.mediawiki.org 2014-01-28 07:06:02 +00:00
title.txt Fix case of some Title methods 2013-03-26 10:54:15 +01:00

/docs Directory README
======================

The 'docs' directory contain various text files that should help you understand
the most important parts of the code of MediaWiki. More in-depth documentation
can be found at:
  https://www.mediawiki.org/wiki/Manual:Code

API documentation is automatically generated and updated daily at:
  https://doc.wikimedia.org/mediawiki-core/master/php/html/

You can get a fresh version using 'make doc' or mwdocgen.php in the
../maintenance/ directory.


For end users, most of the documentation is located online at:
  https://www.mediawiki.org/wiki/Help:Contents
Documentation for MediaWiki site administrators is at:
  https://www.mediawiki.org/wiki/Manual:Contents