Page MenuHomePhabricator

File namespace name in Special:FilePath may be shown with incorrect directionality
Closed, ResolvedPublic

Description

Special:FilePath says "{{ns:file}}:". If you're using an RTL wiki with uselang=en, the ':' will be displayed at the wrong end of the word, so its direction must be set explicitly according to the wiki's language.

I tried solving it by adding a magic word that returns the wiki's directionality, but there was objection to it, saying that it's too complicated (see Bug 30919). I gave it a thought and i agree with Niklas' comment: too much markup in a message makes it hard to read and translate, so it should be avoided.

Since the code part of the message would be the same in all the languages - <span dir="XXX">{{ns:file}}:</span>, it can be written right in the PHP code and passed to the message as a parameter. However, this message is called from SpecialPage->outputHeader and i couldn't find an easy way to pass parameters to it without overriding the function. But then i'm not not yet very experienced with the message functions. Assistance would be appreciated.


Version: unspecified
Severity: normal

Details

Reference
bz30977

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:50 PM
bzimport set Reference to bz30977.
bzimport added a subscriber: Unknown Object (MLST).

To me, it looks like overriding SpecialPage::outputHeader would be the right thing to do in this case.

Well, what you want here isn't to tell the directionality of the content language, but to tell the inherent directionality of the File namespace's default name in the current content language, I think?

You don't necessarily know whether it's going to be localized (as it is in Hebrew) or an English fallback name.

And honestly since it's written in an English context here, it looks reasonably ok to have the colon appear after, as in English.

The best fix would actually be to just get rid of the message entirely and make sure that Special:Filepath takes input with or without the namespace name -- it's simply a totally unnecessary requirement and there's no reason to bother the user with the demand in the first place.

Ok, looks like the 'without the namespace' limitation was a regression in r43471 -- prior to that, Special:Filepath handled input using Title::newFromText($file, NS_IMAGE) which would work both with and without the namespace.

Any objection to reverting r43471 and removing the extra line from filepath-summary?

Merged to 1.18 as r97559.

Note that translated messages will still need updating -- should happen as normal through translatewiki.net.