Merge "mediawiki.Title: Change internal 'title' field to include file extension"
[lhc/web/wiklou.git] / docs / magicword.txt
index 46fcecc..42f701c 100644 (file)
@@ -28,16 +28,16 @@ Create a file called ExtensionName.i18n.magic.php with the following contents:
 ----
 <?php
 
-$magicWords = array();
+$magicWords = [];
 
-$magicWords['en'] = array(
+$magicWords['en'] = [
        // Case sensitive.
-       'mag_custom' => 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:
 ----
 <?php
 
-$magicWords = array();
+$magicWords = [];
 
-$magicWords['en'] = array(
+$magicWords['en'] = [
        // Case insensitive.
-       'mag_custom' => 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