--- Comment #4 from Philippe Verdy <verd...@wanadoo.fr> ---
It is deployed in all Wikimedia wikis, and notably multilingual wikis like
commons, Meta, and MediaWiki.wiki itself that have lots of use of #language to
create language navigation bars
The Language bars also performs detection of translations in various ways to
pages, that are either translated with Translate extension or manuall created
with expected differences between languages (e.g. for pages containing user
groups per language, or different contact addresses, or specific items or
issues in specific languages). Or because they need to support some extra
languages not supported by the Translate extension, or because they want to
disable some existing translations that have been blocked from edits and are no
longer maintained (but not deleted and kept as historic).
Detecting existing translations will frequently test the presence of subpages,
and if one is found, it will attempt to reference it in the navigation bar
using a language name returned by #language, but displayed either in the user's
own language, or in the page-content language (both could be different from the
language autonym returned by #language with only 1 parameter.
But the bug is critical when trnalsations are derived from a base page, because
the base page must know that it's the original and not a translation in a
As the base page does not have its last subpagename segment matching any
language code, vyr could contain any character authorized in pagenames
(including quotes and ampersands) it is difficult to avoid the case where
#language will be called with the second parameter matching the original
However it is expected that if code2 does not match any valid language code, it
will be considered as not being a translation but the source language (usually
English on multilingual wikis of Wikimedia, but not necessarily).
So #language should ignore code2 in this case and use only code1, i.e. return
the autonym, or it could use another fallback such as the user's language, or
the page content language if #language can detect it from another source (which
one if this cannot be deduced from the current page name alone, if there's no
language metadata stored for the current page itself?), or the wiki default
language (not always English).
I think that the simplest fix is to discard code2 in this case and return the
autonym (it's not the job of #language to determine another fallback chain,
unless #language accepts more than 2 codes, in a list of parameters target
language codes to look for (if scanning this list is terminated without finding
a valid language, and then none of them provide applicable fallbacks, use code1
as the final target, so return an autonym only).
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
Wikibugs-l mailing list