MediaWiki REL1_31
MediaWikiI18N.php
Go to the documentation of this file.
1<?php
29 private $context = [];
30
35 function set( $varName, $value ) {
36 wfDeprecated( __METHOD__, '1.31' );
37 $this->context[$varName] = $value;
38 }
39
43 function translate( $value ) {
44 wfDeprecated( __METHOD__, '1.31' );
45 // Hack for i18n:attributes in PHPTAL 1.0.0 dev version as of 2004-10-23
46 $value = preg_replace( '/^string:/', '', $value );
47
48 $value = wfMessage( $value )->text();
49 // interpolate variables
50 $m = [];
51 while ( preg_match( '/\$([0-9]*?)/sm', $value, $m ) ) {
52 list( $src, $var ) = $m;
53 Wikimedia\suppressWarnings();
54 $varValue = $this->context[$var];
55 Wikimedia\restoreWarnings();
56 $value = str_replace( $src, $varValue, $value );
57 }
58 return $value;
59 }
60}
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
Wrapper object for MediaWiki's localization functions, to be passed to the template engine.
translate( $value)
@deprecate since 1.31 Use BaseTemplate::msg(), Skin::msg(), or wfMessage() instead.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition deferred.txt:11
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services