有些注定了被遗忘的话,也就有的注定了属于沉静的自私.

Mediawiki 命名空间/初见时

来自森亮号航海见识 {SLboat Insight;}
跳转至: 导航搜索

发现

  • 它是原始语言关联的,初始化的,即便你切换语言了
JustCapIt5788.jpg
  • 在js环境中可以看到它们
wgNamespaceIds
Object {媒体文件: -2, 特殊: -1, 翻译咯: "NS_TRANSLATIONS", : 0, 讨论: 1, 用户: 2}
: 0
category: 14
category_talk: 15
file: 6
file_talk: 7
help: 12
help_talk: 13
image: 6
image_talk: 7
media: -2
mediawiki: 8
mediawiki_talk: 9
mediawiki讨论: 9
project: 4
project_talk: 5
special: -1
talk: 1
template: 10
template_talk: 11
user: 2
user_talk: 3
widget: 274
widget_talk: 275
分类: 14
分类对话: 15
分类讨论: 15
图像: 6
图像对话: 7
图像讨论: 7
媒体: -2
媒体文件: -2
对话: 1
帮助: 12
帮助对话: 13
帮助讨论: 13
文件: 6
文件对话: 7
文件讨论: 7
档案: 6
档案对话: 7
档案讨论: 7
森亮号航海见识_{slboat_insight;}: 4
森亮号航海见识_{slboat_insight;}讨论: 5
模板: 10
模板对话: 11
模板讨论: 11
特殊: -1
用户: 2
用户对话: 3
用户讨论: 3
翻译: 1198
翻译咯: "NS_TRANSLATIONS"
翻译讨论: 1199
讨论: 1
最重要的看起来就是id了

想法

  • 如何增加它,翻译它呢

尝试

  • 试图修改一个名字空间看看
$namespaceNames["NS_TRANSLATIONS"] = '翻译咯';
但是未启到作用遗憾
  • 新增名字空间看看
$wgExtraNamespaces["NS_TRANSLATIONS"] = '翻译咯';
啊哈成功了,但是不会覆盖原来的
  • 试试不要分号,依然不行
$wgExtraNamespaces[NS_TRANSLATIONS] = '翻译咯';

官方页面

  • 所有关于名字空间
http://www.mediawiki.org/wiki/Help:Namespaces
  • 自定义名字空间
http://www.mediawiki.org/wiki/Manual:Using_custom_namespaces

见识

Help:Namespace - Meta 沿途见识[1]

$namespaceNames = array(
    NS_MEDIA => 'Media',
    NS_SPECIAL => 'Special',
    NS_MAIN => ,
    NS_TALK => 'Talk',
    NS_USER => 'User',
    NS_USER_TALK => 'User_talk',
    # NS_PROJECT set by $wgMetaNamespace
    NS_PROJECT_TALK => '$1_talk',
    NS_FILE => 'File',
    NS_FILE_TALK => 'File_talk',
    NS_MEDIAWIKI => 'MediaWiki',
    NS_MEDIAWIKI_TALK => 'MediaWiki_talk',
    NS_TEMPLATE => 'Template',
    NS_TEMPLATE_TALK => 'Template_talk',
    NS_HELP => 'Help',
    NS_HELP_TALK => 'Help_talk',
    NS_CATEGORY => 'Category',
    NS_CATEGORY_TALK => 'Category_talk',
);

Manual:Using custom namespaces - MediaWiki 沿途见识[2]

reating a custom namespace

Custom namespaces are created via manipulation of the $wgExtraNamespace global variable. Manipulation of this variable must be completed before completion of MediaWiki initialization; for instance it cannot be manipulated in a extension post initialization hook. As an example of simple custom namespace creation, one can add an appropriate line to LocalSettings.php, e.g.

$wgExtraNamespaces[500] = "Foo";
Note the use of the constant 500 in defining the namespace. All namespaces require a numerical index; for custom namespaces, the indices start at 100. In choosing such an index, you may want to avoid any that is listed in extension namespace registration as being used by an extension, since you might want to install that extension later. It is important to remember that an even namespace index denotes a subject namespace, whereas an odd index denotes a discussion ("talk") namespace. It is recommended that you define a discussion namespace with each custom namespace, so the declaration above might be expanded to:

$wgExtraNamespaces[500] = "Foo";
$wgExtraNamespaces[501] = "Foo_talk";
With this declaration, if a page is moved to the Foo namespace, numbered 500, you will be prompted to move the associated talk page. If you choose to do so, MediaWiki will place the page in the namespace numbered 501.

If you need to refer to the ID of your namespace later on in the configuration, for example for $wgNamespaceProtection, $wgNamespacesWithSubpages or an extension like Lockdown, it is recommended that you define constants for your namespace IDs (only letters, numbers and underscores allowed):

define("NS_FOO", 500);
define("NS_FOO_TALK", 501);
 
$wgExtraNamespaces[NS_FOO] = "Foo";
$wgExtraNamespaces[NS_FOO_TALK] = "Foo_talk"; // underscore required
 
$wgNamespaceProtection[NS_FOO] = array( 'editfoo' ); //permission "editfoo" required to edit the foo namespace
$wgNamespacesWithSubpages[NS_FOO] = true; //subpages enabled for the foo namespace
$wgGroupPermissions['sysop']['editfoo'] = true; //permission "editfoo" granted to users in the "sysop" gro

Manual:Namespace - MediaWiki 沿途见识[3]

Built-in namespaces

MediaWiki ships with 18 built-in namespaces:

16 "real" namespaces, corresponding to actual pages, numbered 0 to 15, and grouped in subject/talk pairs
2 "virtual" namespaces (one for dynamically generated special pages, and one serving as an alias for direct file links), numbered -1 and -2, respectively. Since these namespaces don't correspond to pages stored in the database, one cannot create or delete pages in these namespaces, and there are no corresponding discussion namespaces.
The full list is presented in the table below.

Index Name Purpose Talk
0 (Main) "Real" content; articles.[1] Talk 1
2 User User pages.[2] User talk 3
4 Project Information about the wiki.[3] Project talk 5
6 File Media description pages File talk 7
8 MediaWiki Site interface customisation[4] MediaWiki talk 9
10 Template Template pages Template talk 11
12 Help Help pages Help talk 13
14 Category Category description pages Category talk 15
-1 Special Holds special pages N/A
-2 Media Alias for direct links to media files


引用信息

以下是[Mediawiki 命名空间/初见时]所有用到的引用信息,向这些伟大的家伙致敬:
  1. ^ Help:Namespace - Meta, 见识于2013-6-2 12:46
  2. ^ Manual:Using custom namespaces - MediaWiki, 见识于2013-4-21 18:15
  3. ^ Manual:Namespace - MediaWiki, 见识于2013-4-21 18:15