Page MenuHomePhabricator

Parser function to override per-page language metadata
Closed, ResolvedPublic

Description

Author: barabbas

Description:
Checks available language codes of Template:Languages to set xml:lang dynamically

Currently xml:lang is set by $wgContentLang only. It's not good to search engines to determine the real content language of a specific page.

The patch checks available language codes of Template:Languages to set xml:lang dynamically. It's particularly important to http://wikimania2007.wikimedia.org or other sites used Template:Language.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=9360

attachment Setup.php.diff ignored as obsolete

Details

Reference
bz10736

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:47 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz10736.
bzimport added a subscriber: Unknown Object (MLST).

ping.nsr.yeh wrote:

grab the language code from URL (if present) to initialize $wgContLang

This patch file is in the universal format. Hopefully it is straightforward to apply it.

Attached:

barabbas wrote:

Please consider patch this to Wikimania sites ASAP, thanks a lot!

robchur wrote:

This patch is far too project-specific and mangles configuration settings according to an apparently arbitrary title pattern. I would not recommend using it.

It seems that a better choice would be some kind of magic word which can be used to override the various language meta tags for a page.

barabbas wrote:

I agree with Rob now since I just found a side effect yesterday. Once we change wgContLanguage, namespaces like Category or Template may encounter problem if they are not in English.

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

Barabbas, I've added the "reviewed" keyword since you did get a code review. Are you interested in checking out current trunk, seeing whether the situation still requires fixing, and trying to update your patch against trunk?

Thanks!

barabbas wrote:

Hi,

I'm afraid that I'm not qualified to check out current trunk anymore since it's been long long time ago.

My apologies.

(In reply to comment #6)

Barabbas, I've added the "reviewed" keyword since you did get a code review.
Are you interested in checking out current trunk, seeing whether the situation
still requires fixing, and trying to update your patch against trunk?

Thanks!

(In reply to comment #7)

I'm afraid that I'm not qualified to check out current trunk anymore since
it's
been long long time ago.

Barabbas, thanks; new patches are always welcome ([[mw:Git/Tutorial]]).

I'm closing this old bug since:

  • The original use case has been solved by the introduction of the page content language and by using the Translate extension, which sets the page content language correctly
  • The general need to set the page content language on-wiki is covered by bug 9360, bug 49588, etc. (where most discussion has occurred)
  • This bug has been marked as a duplicate of bug 9360 ***