Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
lc.php
Go to the documentation of this file.
1<?php
2
19function wfAddNamespace( $id, $name, $constant = null ) {
20 global $wgExtraNamespaces, $wgContentNamespaces, $wgTranslateMessageNamespaces,
21 $wgNamespaceProtection, $wgNamespacesWithSubpages, $wgNamespacesToBeSearchedDefault;
22
23 if ( $constant === null ) {
24 $constant = strtoupper( "NS_$name" );
25 }
26
27 define( $constant, $id );
28 define( $constant . '_TALK', $id + 1 );
29
30 $wgExtraNamespaces[$id] = $name;
31 $wgExtraNamespaces[$id + 1] = $name . '_talk';
32
33 $wgContentNamespaces[] = $id;
34 $wgTranslateMessageNamespaces[] = $id;
35
36 $wgNamespacesWithSubpages[$id] = true;
37 $wgNamespacesWithSubpages[$id + 1] = true;
38
39 $wgNamespaceProtection[$id] = [ 'translate' ];
40
41 $wgNamespacesToBeSearchedDefault[$id] = true;
42}
wfAddNamespace( $id, $name, $constant=null)
Helper function for adding namespace for message groups.
Definition lc.php:19