Last modified: 2011-09-20 09:19:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32569, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30569 - Auto detect username when {{gender:}} is used in User or User talk spaces
Auto detect username when {{gender:}} is used in User or User talk spaces
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Unprioritized enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks: gender
  Show dependency treegraph
 
Reported: 2011-08-25 16:28 UTC by Gustronico
Modified: 2011-09-20 09:19 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gustronico 2011-08-25 16:28:25 UTC
{{gender:}} is a very useful function to make templates like userboxes and user-related messages be more expressive, especially in some non-English languages. In Spanish for instance, the expression "This user is a doctor" is gender dependant, so you *must* say "[Este usuario|Esta usuaria] es un doctor".

Those templates are almost always transcluded into User or User talk pages, so automatic username detection (if gender parameter is left blank) would be a nice facilitation. Note that {{PAGENAME}} is not a good username detector because it doesn't work correctly in subpages and archived discussions, so a more complex construction like {{#titleparts:{{PAGENAME}}|1}} must be used, but it would be easier omit it  instead:

{{gender:|Este usuario|Esta usuaria}} es un doctor.

Alternatively, a {{USERNAME}} variable would be a more general solution for username detection when used into user spaces. It could also be used in phrases like:
Hi {{USERNAME}}! instead of Hi {{PAGENAME}}!
Comment 1 Leinad 2011-08-25 18:35:07 UTC

*** This bug has been marked as a duplicate of bug 27364 ***
Comment 2 Gustronico 2011-08-26 15:48:59 UTC
Sorry. I realized that USERNAME is not a good name for the variable I'm requesting for. I better change it for {{PAGEOWNER}} or {{USERSPACENAME}}, ie the name of the user whose personal space includes the variable.

Thus {{PAGEOWNER}} = {{#titleparts:{{PAGENAME}}|1}}
Comment 3 Gustronico 2011-08-26 15:52:28 UTC
(In reply to comment #1)

This is *not* a duplicate of bug 27364
Comment 4 Beau 2011-08-26 15:53:28 UTC
You can always create a template named PAGEOWNER. I don't think there is a need
for another magic word.
Comment 5 Gustronico 2011-08-26 16:19:43 UTC
You're right. The PAGEOWNER idea is just an alternative, the main request is that the default username of {{gender:|male|female}} should be the owner of the page where the function is included.
Comment 6 Purodha Blissenbach 2011-09-03 17:25:42 UTC
In MediaWiki:xyzzy, {{GENDER:|male|female|unknown}} is already addressing
the reader of a messae, i.e. the currently logged in user. I doubt that is
is a good idea to alter this behavour for other namespaces, because it is
possible (though hardly advisable) to transclude those message anywhere
with {{:MediaWiki:xyzzy}} and {{:MediaWiki:xyzzy/zxx}} and with {{int:xyzzy}}
and we were likely to create inconsistencies.

Since contributions are possibly moved or copied around, my preference goes
with something like {{GENDER:username|male|female|unknown}} with a verbatim
user name for the cases this bug is about. That can be had with 
{{GENDER:{{subst:#titleparts:{{PAGENAME}}|1}}|male|female|unknown}} on user
page, user  talk pages, and their subpages, if I am not mistaken.
Comment 7 Gustronico 2011-09-03 18:57:32 UTC
(In reply to comment #6)
> In MediaWiki:xyzzy, {{GENDER:|male|female|unknown}} is already addressing
> the reader of a messae, i.e. the currently logged in user.

Are you sure? Can you link a MediaWiki-spacename page where {{gender:|}} with
empty username is included? If it is, I doubt it would be the better default.
Default options should correspond to the more frequently encountered
situations.

IMHO, gender function will bring much more utility (ie. more frequent usage) in
user space pages messages and userboxes, where messages both from and to the
page owner should be easily gender-customized.
Comment 8 Krinkle 2011-09-03 18:58:48 UTC
(In reply to comment #2)
> Sorry. I realized that USERNAME is not a good name for the variable I'm
> requesting for. I better change it for {{PAGEOWNER}} or {{USERSPACENAME}}, ie
> the name of the user whose personal space includes the variable.
> 
> Thus {{PAGEOWNER}} = {{#titleparts:{{PAGENAME}}|1}}

What about {{BASEPAGENAME}} ?
Comment 9 Niklas Laxström 2011-09-03 19:12:19 UTC
(In reply to comment #7)
> Are you sure?

He is correct. I wrote the feature that way.
Comment 10 Gustronico 2011-09-03 19:39:45 UTC
(In reply to comment #8)
> What about {{BASEPAGENAME}} ?

{{BASEPAGENAME}} doesn't always return the username. See what happens in page "User:Example/Archive/2010"

{{BASEPAGENAME}} → Example/Archive
{{#titleparts:{{PAGENAME}}|1}} → Example

Furthermore, {{PAGEOWNER}} should also check for the namespace to be User or User Talk, and if not, then should return nothing.

(In reply to comment #9)
> He is correct. I wrote the feature that way.
Ok thanks. I would have done a test before posting here if I could, but I'm not a bureaucrat. Nevertheless I searched for such a case and could not find any.
Comment 11 Niklas Laxström 2011-09-20 09:19:09 UTC
While {{BASEPAGENAME}} doesn't work, {{#titleparts:}} does.
See http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23titleparts
And you can always wrap it in a nice template :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links