On Mon, Aug 15, 2011 at 1:23 PM, Robin Pepermans <robinp.1273(a)gmail.com>wrote;wrote:
Hi,
I usually don't post to mailing lists, but Brion suggested I should do
this for the page content language.
Thanks! :D
I suppose most people now that I improved the RTL
support.
Documentation of that is now at
http://www.mediawiki.org/wiki/Directionality_support
If it is incomplete or unclear about something, please ask so I can
improve the docs.
While doing that, I introduced a "page content language" that defines
the language in which a specific page is written. I added docs for
that as well, see
http://www.mediawiki.org/wiki/Language_in_MediaWiki
For special pages it is $wgLang, for MediaWiki namespace pages it
depends on the subpage code, for other pages it is $wgContLang.
Extensions (like Translate) can change the language a page is supposed
to be written in.
This affects the direction of the content, the TOC, and (in theory) the
grammar.
Again, if the docs are missing something important, let me know.
I am super happy about this going in as a general concept -- we'll want to
make sure there's a way for 'generic' multilingual sites (like meta and
commons) to tag pages with their languages as well.
Note for those not reading through the links ;) -- you can get a language
from a Title object with $title->getPageLanguage(). There's no actual
storage of the value now; it just handles some standard logic (special pages
are user lang; MediaWiki pages use the language, etc) and provides a hook
that extensions can grab to override info for any particular page.
For Translate and Incubator, language can be easily pulled from the title as
language codes get used as a page title component (suffix or prefix or some
such). However for more general pages this may end up being better defined
as metadata tied to the page, which'll need storage and being kept across
export/import, delete/undelete, etc.
It's conceivable that we might want to move that interface over from Title
to WikiPage or something, though Title seems to fit best with how we tend to
index these things for now (editing protections are also accessed via
Title).
But, now that I am writing this anyway, I have a
question: should
magic words like CURRENTMONTH and NUMBEROFARTICLES use the page
content language rather than wgContLang? It would be more logical (and
on Incubator even wanted:
http://incubator.wikimedia.org/wiki/Template:Wp/lkt/CURRENTMONTHNAMEI
) but I am not sure if it would break things, e.g. when just with a
template.
I would tend to expect it to use the page content language; for templates of
course you may well have the issue that the template is trying to work in a
particular language, say to generate a link, so that may require some
pondering. :)
If we pull a template into a parent page, does the template have its own
inherent languageness? This is all relevant also to tagging output for
languages to aid with screen readers, translation tools, search engines etc
-- bug 14649 <https://bugzilla.wikimedia.org/show_bug.cgi?id=14649> gives an
example of this with messages but templates can have the same issues.
-- brion
(And btw, another i18n thing that needs attention is LanguageConverter
(even just for missing docs). I am looking if I can help out there.)
Regards,
Robin aka SPQRobin
_______________________________________________
Wikitech-l mailing list
Wikitech-l(a)lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l