Page MenuHomePhabricator

Patch fixing hardcoded links in interface messages
Closed, ResolvedPublic

Description

Author: arnomane

Description:
MediaWiki interface messages contain hardcorded links into the project namespace (the pages don't exist by default).

Thus:

I have replaced every call of "Project:PAGENAME" in messages with a template call of the page that defines the link
targets.

I have added to the after-installation-mainpage a list of pages not existing in vanilla MediaWiki which interface
definition files (in any language) expect to exist though. So people have a quick overview in ne place which pages they
need to customize in order to avoid broken links in the interface.

I have started with the MessagesEn.php. If the patch gets applied step 1) should be applied to all 151 MessageXX.php files
as this problem causes quite some trouble in multilingual wikis and as the fix can be done in a search and replace manner
which doesn't change any real text (and thus you don't need to know the language of the language file you are fixing).

See this thread: http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/029298.html for details, especially this
mail http://lists.wikimedia.org/pipermail/wikitech-l/2007-January/029326.html outlines the problem for multilingual wikis.


Version: unspecified
Severity: normal

Details

Reference
bz8846

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8846.
bzimport added a subscriber: Unknown Object (MLST).

arnomane wrote:

Patch fixing hardcoded links in interface messages

patch for above described bug

attachment MessagesEn.php.diff ignored as obsolete

arnomane wrote:

same patch as above but with "svn diff" instad of plain "diff"

thanks to Raymond for pointing out the format issue and helping me with the
patch ;-)

attachment Patch2-MessagesEn.php.diff ignored as obsolete

arnomane wrote:

improved version that now lists all url definitions

Bug #6038 does cover a very similar topic. Especially the attached file there
does list all static urls. I checked all urls listed there against the current
version of MessagesEn.php and found three url definitions I did forget to add
to the table on the initial main page.

I now have checked all internal links. However the external links listed at Bug
#6038 still need some kind of treatment. As this is different from the internal
links I left it for the time being.

attachment MessagesEn.php.patch2.diff ignored as obsolete

ayg wrote:

Tim has had performance concerns in the past with using curly-brace syntax in too many messages. I
for one am not going to commit until this gets run by him.

arnomane wrote:

Pardon? This does not introduce new "curly-brace syntax". If you look you will see that the number has been exactly
the same.

ayg wrote:

Sorry, my bad, you're correct.

arnomane wrote:

same patch as patch2 but without the url table on inital main page

If you don't like the table on intitial main page apply this patch to
mediawiki-svn

attachment MessagesEn.php.patch3.diff ignored as obsolete

leon wrote:

Patch applied in r19724. If noone stabs you, please reopen and attach the patch
for the remaining files :-P

arnomane wrote:

link corection patch for MessagesXX.php from A-C

This patch contains the first follow up to the above patch applied to SVN. At
contains the fixes for the message files starting from A including C, excluding
MessagesAr.php (will follow later) and inclduing further fixes for
MessagesEn.php.

The fixes include replacement of hardcoded project namespace links, replaced
hardcoded localised namespace names, replaced local wiki markup. The
Messages.En.php namespace calls were replaced by {{ns: in order to indicate to
translators that they shouldn't translate these in messages (very common
mistake).

attachment MessagesA-C.diff ignored as obsolete

arnomane wrote:

P.S.: All links wich I as unable to resolve are marked with a comment and are subject to later retranslation from the
english message file by the translators of these files.

arnomane wrote:

same patch as above for A-C but usage of {{ns: only in places where needed

As well some other small fixes

attachment MessagesA-C-2.diff ignored as obsolete

arnomane wrote:

Leon applied the last patch to SVN today.

I submitted a patch for the Latin localization (la) that hopefully
addresses all the concerns raised here: bug8998

arnomane wrote:

Same patch as above for F to H

This bug fixes (or highlights in case I was not able fixing it due to language
problems) the above mentioned link problems for message files from F to H,
leaving MessagesFa.php and MessagesHe.php out for the time being (RTL languages
will follow later otherwise I will get crazy ;).

Attached:

leon wrote:

Applied in SVN trunk, r19985.

leon wrote:

(In reply to comment #12)

Leon applied the last patch to SVN today.

For reference: it's r19794.