X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=docs%2Fmagicword.txt;h=42f701ca0bc481512a539c3e953cefc3ddb86acc;hp=46fcecc7af98082242143729af8ccd86e15f8164;hb=e9daa066fe09dea9c06c2a59c64d8ad16be8b0bc;hpb=c2665e4b6e615c80e4126f1ff343e7f9f3018dcc diff --git a/docs/magicword.txt b/docs/magicword.txt index 46fcecc7af..42f701ca0b 100644 --- a/docs/magicword.txt +++ b/docs/magicword.txt @@ -28,16 +28,16 @@ Create a file called ExtensionName.i18n.magic.php with the following contents: ---- array( 1, 'CUSTOM' ), -); + 'mag_custom' => [ 1, 'CUSTOM' ], +]; -$magicWords['es'] = array( - 'mag_custom' => array( 1, 'ADUANERO' ), -); +$magicWords['es'] = [ + 'mag_custom' => [ 1, 'ADUANERO' ], +]; ---- $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php'; @@ -62,16 +62,16 @@ Create a file called ExtensionName.i18n.magic.php with the following contents: ---- array( 0, 'custom' ), -); + 'mag_custom' => [ 0, 'custom' ], +]; -$magicWords['es'] = array( - 'mag_custom' => array( 0, 'aduanero' ), -); +$magicWords['es'] = [ + 'mag_custom' => [ 0, 'aduanero' ], +]; ---- $wgExtensionMessagesFiles['ExtensionNameMagic'] = __DIR__ . '/ExtensionName.i18n.magic.php'; @@ -86,10 +86,10 @@ function wfGetCustomMagicWordValue( &$parser, $var1, $var2 ){ return "custom: var1 is $var1, var2 is $var2"; } -Note: the 'ParserFirstCallInit' hook is only aviable since 1.12. To work with +Note: the 'ParserFirstCallInit' hook is only available since 1.12. To work with an older version, you'll need to use an extension function. Online documentation (contains more informations): Magic words: https://www.mediawiki.org/wiki/Manual:Magic_words Variables: https://www.mediawiki.org/wiki/Manual:Variable -Parser functions: https://www.mediawiki.org/wiki/Manual:Parser_functions \ No newline at end of file +Parser functions: https://www.mediawiki.org/wiki/Manual:Parser_functions