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 $wgVisualEditorAvailableNamespaces;
23
24 if ( $constant === null ) {
25 $constant = strtoupper( "NS_$name" );
26 }
27
28 define( $constant, $id );
29 define( $constant . '_TALK', $id + 1 );
30
31 $wgExtraNamespaces[$id] = $name;
32 $wgExtraNamespaces[$id + 1] = $name . '_talk';
33
34 $wgContentNamespaces[] = $id;
35 $wgTranslateMessageNamespaces[] = $id;
36
37 $wgNamespacesWithSubpages[$id] = true;
38 $wgNamespacesWithSubpages[$id + 1] = true;
39
40 $wgNamespaceProtection[$id] = [ 'translate' ];
41
42 $wgNamespacesToBeSearchedDefault[$id] = true;
43
44 $wgVisualEditorAvailableNamespaces[$id] = false;
45}
wfAddNamespace( $id, $name, $constant=null)
Helper function for adding namespace for message groups.
Definition lc.php:19