Topic on Project:Support desk

How-to change name of the "Talk" namespace?

9
Danny373 (talkcontribs)

Hi! I've own Wiki based on MediaWiki engine and thinking about globally change the "Talk" (NS_TALK) namespace to "Journal". It is possible to change the built-in "Talk" namespace to other name?

Thank you in advance for your help and any suggestions.

Thorncrag (talkcontribs)

I am not entirely sure about renaming the talk namespace, but what is your goal? If you just want a namespace for some kind of journal, it would be much more advisable to simply create the new namespace. If you want a tab for "Journal" to appear next to the talk tab, you can add that fairly simply, using something like jQuery.

Bawolff (talkcontribs)

You can change how the talk namespace is displayed by creating mediawiki:nstab-talk (for just the main talk namespace) or editing MediaWiki:Talk (if you want to change _all_ talk namespaces).

Danny373 (talkcontribs)

Thorncrag, thank you for your help. You wrote:

> what is your goal?

Originally, I wanted to create a new tab next to "Comments" tab. Just as it is done (or similar) on tne WikiNews site - see "Opinions" tab. It had previously been asked about this in my another thread, but unfortunately did not get answers and any solutions.

> If you want a tab for "Journal" to appear next to the talk tab,
> you can add that fairly simply, using something like jQuery.

I tried to do so as indicated, but the new tab is located (jQuery code puts it) in the <div id="p-views" class="vectorTabs"> section ("Read"|"Edit"|"History" tabs) not in the <div id="p-namespaces" class="vectorTabs"> section ("Article"|"Discussion" tabs).

Because it's so hard to make a new tab, the only solution is to change "Comments" tab to the "Journal" tab in my case.

Bawolff (talkcontribs)

btw, Wikinews js for the comments tab is at n:en:MediaWiki:Comments.js . Try just copying that to your mediawiki:Common.js (note, on wikinews named comments.js but on your wiki you have to put it on Common.js)

Danny373 (talkcontribs)

@Bawolff, @Thorncrag: Many thanks to you!

I created a new namespace (by Thorncrag idea) and adapted the "Comments.js" script (by Bawolff idea) from the WikiNews page to my Wiki. And... it works very well! :-)

BTW, I found a small bug in their script.

Best Regards,

DeirdreAnne (talkcontribs)

BTW, If you really wanted to change the name of the namespaces, as opposed to merely how they display on the tab, it could be done in local settings for any custom namespaces and I'm pretty sure you could change the standard namespaces the same way - or you could set aliases. Then you could use /wiki/Journal:Foo in the address bar and [[Journal:Foo]] in links (in place of [[Talk:Foo]] and similarly for the talkspaces that correspond to namespaces other than main, thus [[Bar journal:Foo]] for the talk page of for Foo in the Bar namespace). In this case you would have all odd numbered namespaces with "journal" in the name in place of "talk". An alias would be best for this as it would avoid changing something that is standard across all english langauge wikis. This doesn't sound like what you want to do but it is the question you originally asked. ;-)

Hazard-SJ (talkcontribs)

Could $wgExtraNamespaces[NS_TALK] = "Journal"; override this?

Bawolff (talkcontribs)

>Could $wgExtraNamespaces[NS_TALK] = "Journal"; override this?

yes, that would "rename" the talk namespace.

Reply to "How-to change name of the "Talk" namespace?"