Page MenuHomePhabricator

Tutorial language should use the usual language fallback mechanisms
Closed, ResolvedPublic

Description

Author: neilk

Description:
In UploadWizardTutorial, the method of obtaining the localized tutorial file is overly naive; if the exact language is not available it shows an apology and error.

However, there are fallbacks mechanisms for dialects that are well known within MediaWiki code (for instance en-gb can fall back to en without much difficulty).

Since the fallbacks can sometimes involve trying multiple dialects, and looking up the existence of a file can be potentially time-consuming, the mapping of a language dialect to the best available tutorial may need to be cached.


Version: unspecified
Severity: normal

Details

Reference
bz26342
TitleReferenceAuthorSource BranchDest Branch
add php 8 imagesrepos/releng/dev-images!5brennenwork/brennen/buster-php80main
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:23 PM
bzimport added projects: UploadWizard, I18n.
bzimport set Reference to bz26342.
bzimport added a subscriber: Unknown Object (MLST).

Let's not talk about dialects, since it's confusing and misleading. The concept is fallback languages in MediaWiki, which can with little effort be extracted (it's a reverse tree with all paths ending in the root node 'en').

It's a wholly different question how to get the messages in the correct language. Again, MediaWiki already does it automatically, but I don't which method (=way of doing) you are using.

neilk wrote:

The tutorial images are created manually. Guillaume extracted all the strings into translatewiki, and then when entire languages were done he created SVG files with those strings, and from there PNG files. It's probably not feasible to do such translation automatically as there are always things to massage.

So, we have a few options, I guess.

We could create aliases? redirects? copies? of a tutorial image for every language for which is was appropriate. That seems wrong to me.

The other way to is to do a lookup of some kind when the UploadWizard page is fetched. In other words, chopping off parts of the language code recursively, checking for the existence of files, and finally substituing 'en' when all else fails.

Or maybe there's a standard way to do this for localized images?

We can walk the fallback chain until image in that languages exists. You just have to decide which is the place to do that.

saibotrash wrote:

Yeay, this bug is one year old! Do something (raised form "enhancement" (wtf... that is a bug) to normal) with this.
Could have saved be some time (the answer below) and some time for the chinese user to report...

from [[:commons:Commons:Upload_Wizard_feedback#.E4.B8.8D.E8.83.BD.E6.98.BE.E7.A4.BA.E4.B8.AD.E6.96.87]]

不能显示中文

<small>User agent: Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; zh-cn) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5</small>

明明有图片[[:File:Licensing tutorial zh-hans.svg]]的,怎么不能显示中文教程呢? [[User:一个|一个]] ([[User talk:一个|<span class="signature-talk">talk</span>]]) 08:53, 10 January 2012 (UTC)

:@Eloquence: Apparently a i18n error (don't know where this need to be corrected... you know: off-wiki...) [commons.wikimedia.org/w/index.php?title=Special:UploadWizard&uselang=zh-cn zh-cn] version errors and loads the english tutorial as a fallback. As the user tells us the zh-hans tutorial would be okay. Note: this fallback was also done in [[MediaWiki:RotateRequest.js]]: one class: "zh, zh-hans, zh-cn, zh-my, zh-sg", another class: "zh-hant, zh-hk, zh-mo, zh-tw". Note2: the tutorial is available in [[:File:Licensing tutorial zh-hans.svg|zh-hans]] and [[:File:Licensing tutorial zh-hant.svg|zh-hant]].
:Similar fail for [
commons.wikimedia.org/w/index.php?title=Special:UploadWizard&uselang=de-at de-at]. Displays the English tutorial instead of the proper fallback to "de". Cheers --[[User:Saibo|Saibo]]&nbsp;([[User talk:Saibo|<small>Δ</small>]]) 14:41, 10 January 2012 (UTC)

saibotrash wrote:

Probably we could just create onwiki redirects - but that is not really the solution. A simple fallback at least for the xx-yy languages should be done (like in RotateRequest.js). Not that hard.

  • Bug 38807 has been marked as a duplicate of this bug. ***

What about solving this server side in MediaWiki? MediaWiki is pretty good at all this i18n fallback things.

Api call: Please give me the tutorial for language de-at in campaign wlm-nl. It would go down the usual de-at -> de -> en chain and return the first success.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:25 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:20 AM