Page MenuHomePhabricator

user language improvement, most useful for multilingual (like commons) sites
Closed, ResolvedPublic

Description

Author: pablo

Description:
Here are some improvemetns for multilingual sites (like commons)


Version: 1.7.x
Severity: normal

Details

Reference
bz6283

Event Timeline

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

pablo wrote:

creates a {{USERLANGUAGE}} variable to tell the user language (it is the pendant to the {{CONTENTLANGUAGE}} existing in svn)

This patch adds a {{USERLANGUAGE}} to tell the suer language (either trough
preferences or uselang= parameter)

It is most usefull on multilingual wikies, like commons:, meta:, etc.

For example, in commons, the curent {{GFDL}} licence template could be moved to
{{GFDL-en}}, and a new {{GFDL}} template be written as this:


{{#ifexist:Template:GFDL-{{USERLANGUAGE}}|{{GFDL-{{USERLANGUAGE}}}}|{{GFDL-en}}}}

<includeonly>[[Category:GFDL|{{PAGENAME}}]]</includeonly>

That is, it will include, if it exists, the template in the user language, if
not, in English.
As a lot of translations for templates and other pages exists, a way to
automatically choose the right one will be very usefull.

This patch allows this by providing a variable showing the user language

Attached:

pablo wrote:

allows headings showing in user language in image description pages

This patch is mostly useful for multilingual sites, like commons:

It allows the image description files to have the headers created at upload
time to be like:

{{int:filedesc}}

that is, the page doesn't use a translation in a given language, but references
the message id and so it will show in the user language, whatever language it
may be.

It is only active if there is in LocalSettings.php a line like this:

$wgIsMultilingual = true;

so it doesn't have any effect on non multilingual wikis.

Attached:

pablo wrote:

you can see a page using {{int:filedesc}} (done manually) at
[[commons:Image:Locusts_feeding.jpg]], if you open it with url parameter
uselang=xx you should see the headings in the language (if you have already
opened the page, you may need alsot to purge it)

  • This bug has been marked as a duplicate of 2085 ***