Page MenuHomePhabricator

Create {{SPACEUSER}} to improve detection of page owner in user spaces, also usable in interface messages, etc.
Closed, DeclinedPublic

Description

Up to now, this only concerned to messages like → Hi {{BASEPAGENAME}}!, what in
"User:Example/Archive/2010" looks → Hi Example/Archive! But now we have a {{gender:}} function to be used not only in user pages and discussions, but in MediaWiki interface messages.

As stated for instance in [[translatewiki:MediaWiki:Nstab-user/qqq]] documentation, "it is possible to use {{GENDER:{{BASEPAGENAME}}|male form|female form}} if needed". And it is what currently puts the Galician translation → [[translatewiki:MediaWiki:Nstab-user/gl]]. But BASEPAGENAME is only a partial approximation to the function needed, provided that it fails to return the user name in some pages.

You can see a live example of this issue at the user space of the female galician user [[:gl:Usuaria:Elvire]] and compare the user tab in her both subpages [[:gl:Usuaria:Elvire/Foo]] and [[:gl:Usuaria:Elvire/Foo/Bar]]. The former shows 'Páxina de usuaria' and the later states 'Páxina de usuario'.

Just as Niklas Laxström suggested to me in bug 30569, comment 11, I've created a simple {{SPACEUSER}} template at es:wikipedia, what is satisfactorily functioning in 15000+ user pages. But it is a local template based on #titleparts, not a MediaWiki function, so it can't be used in translatewiki general messages. I still think that a real {{SPACEUSER}} MediaWiki function should be created to fix this issue. Please excuse me for my poor English. P.S. Formerly, I've called this functionality as PAGEOWNER.


Version: unspecified
Severity: enhancement

Details

Reference
bz32703

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 22 2014, 12:04 AM
bzimport set Reference to bz32703.
bzimport added a subscriber: Unknown Object (MLST).

We have {{BASEPAGENAME}}, {{SUBPAGENAME}}, why not just go for adding a {{ROOTPAGENAME}}?

(In reply to comment #1)

We have {{BASEPAGENAME}}, {{SUBPAGENAME}}, why not just go for adding a
{{ROOTPAGENAME}}?

+1

(In reply to comment #1)

why not just go for adding a {{ROOTPAGENAME}}?

May be an acceptable alternative. But {{SPACEUSER}} is supposed to be only active in User and User talk spaces, and to return only registered usernames, returning nothing in other circumstances. Thus,

"Hi {{SPACEUSER}}" will return "Hi " in a IP user talk. And

{{gender:{{SPACEUSER}} }} won't misunderstand a Template root pagename as a registered user.

(In reply to comment #0)

"it is possible to use {{GENDER:{{BASEPAGENAME}}|male
form|female form}} if needed".

I strictly recommend against using this sort of approach anywhere.
I will inevitably create more problematic issues.

A structurally cleaner way to deal with GENDER is suggested in bug 27743 (Handle GENDER more efficiently)

{{ROOTPAGENAME}} sounds like a good name. It could be used on other namespaces too.

(In reply to comment #3)

"Hi {{SPACEUSER}}" will return "Hi " in a IP user talk. And

Shouldn't that return "Hi <ip>", since they are the "spaceuser" for that talkpage?

(In reply to comment #6)

Shouldn't that return "Hi <ip>", since they are the "spaceuser" for that
talkpage?

I think that the use of an ip address as a [[vocative]] is not a good practice. If you don't know the name of a person, you may use a friendly noun, like "Hi my friend" or so, not a number. (I'm not a English speaker, so excuse me for a better example)

{{SPACEUSER}} is suggested to be a users-specific function, capable to detect registered user names. If it is considered unnecessary, I still can reopen bug 30569 and insist in adding it as a special parameter to gender function:
{{gender:#spaceuser|male form|female form}}

(In reply to comment #5)

{{ROOTPAGENAME}} sounds like a good name. It could be used on other namespaces
too.

Personally, the idea of adding yet another magic word seems kind of silly to me. People have been using #titleparts for this for years, as it's vastly more flexible than an arbitrary set of magic words could ever be.

Does anyone have thoughts about merging the #titleparts parser function into MediaWiki core instead of introducing a new magic word?

(In reply to comment #8)

(In reply to comment #5)

{{ROOTPAGENAME}} sounds like a good name. It could be used on other namespaces
too.

Personally, the idea of adding yet another magic word seems kind of silly to
me. People have been using #titleparts for this for years, as it's vastly more
flexible than an arbitrary set of magic words could ever be.

Very true. This magic word shouldn't be added to MediaWiki core only to be used for some templates of ours, which seems to be the original request here.

Comment 0, however, also mentions the possibility that this magic word might be needed for core system messages like tabs names, in relation to gender. This is quite surprising to me: shouldn't this use case be covered by gender namespaces? If not, this would be a valid request.

(In reply to comment #9)

Comment 0, however, also mentions the possibility that this magic word might be
needed for core system messages like tabs names, in relation to gender. This is
quite surprising to me: shouldn't this use case be covered by gender
namespaces? If not, this would be a valid request.

The issue isn't the namespace. The issue is knowing what user we're supposed to know the gender of. {{GENDER:|...|...}} and {{GENDER:{{BASEPAGENAME}}|...|...}} are two completely different things.

(In reply to comment #10)

(In reply to comment #9)

Comment 0, however, also mentions the possibility that this magic word might be
needed for core system messages like tabs names, in relation to gender. This is
quite surprising to me: shouldn't this use case be covered by gender
namespaces? If not, this would be a valid request.

The issue isn't the namespace. The issue is knowing what user we're supposed to
know the gender of. {{GENDER:|...|...}} and {{GENDER:{{BASEPAGENAME}}|...|...}}
are two completely different things.

Yes, of course. So?
If gender in tabs is wrong, that's a bug by itself.

Summary reverted to original {{SPACEUSER}} request. It is supposed to be only
active in User and User talk spaces, and to return only registered usernames,
returning nothing in other circumstances. May be it also would accept a parameter for a friendly vocative term, like Hi {{SPACEUSER|my friend}}!

(In reply to comment #12)

Summary reverted to original {{SPACEUSER}} request. It is supposed to be only
active in User and User talk spaces, and to return only registered usernames,
returning nothing in other circumstances. May be it also would accept a
parameter for a friendly vocative term, like Hi {{SPACEUSER|my friend}}!

Ok, thanks for the clarification: then this is not something we're going to do, most likely; closing accordingly, for better clarity.
Please use (templates with) titleparts, if you need to write to people on their subpages instead of the designated talk page.

(In reply to comment #13)

Please use (templates with) titleparts, if you need to write to people on their
subpages instead of the designated talk page.

I think you partially misunderstand the problem. titleparts works for talks, ok, but interface messages issue persists. See summary ending: "also usable in interface messages"

(In reply to comment #11)

Yes, of course. So?
If gender in tabs is wrong, that's a bug by itself.

This is not exactly a gender bug.
The problem consists in that there is no secure way to detect the username of
the registered 'owner' of a space, being it to be used either for friendly
messages or for *core interface* ones.

(In reply to comment #11)

If gender in tabs is wrong, that's a bug by itself.

This is not exactly a gender bug.
The problem consists in that there is no secure way to detect the username of
the registered 'owner' of a space, being it to be used either for friendly
messages or for *core interface* ones.

Please file a bug for each system message which should support gender and doesn't. Thanks!

(In reply to comment #15)

Please file a bug for each system message which should support gender and
doesn't. Thanks!

Bag 45938 opened.

Note: This is a horrible hack to obtain the username of the 'owner' of the page, up to 5th level of subpages, without using #titleparts. It also works in the User talk namespace:

{{BASEPAGENAME:User:{{BASEPAGENAME:User:{{BASEPAGENAME:User:{{BASEPAGENAME:User:{{BASEPAGENAME}}}}}}}}}}