Page MenuHomePhabricator

Investigation: Creating an i18n framework for gadgets
Closed, ResolvedPublic

Description

Currently most gadgets have no i18n support at all. (RefToolbar is the only one I know of and it's very basic.) A lot of wikis are now loading gadgets from other projects via mw.loader.load, so it would be nice if there was an easy and standardized way to add i18n support for these gadgets.

Questions to answer:

  • How would such an i18n system work?
  • What would be its limitations? For example, could it support grammar features like plurals, gender, etc.?
  • How would translations be solicited?
  • How much work would be involved in implementing it as a proof-of-concept?
  • What's the status of Gadgets 2.0 and how much overlap is there?

Timebox: 1 day (assuming we can get ahold of folks that know about Gadgets 2.0)

Event Timeline

kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added a project: Community-Tech.
kaldari subscribed.

I think this would be a lot more achievable if all the gadgets were centralized to Meta/elsewhere.

An oldie!

Here's one of my attempts: (do not ever look at it, or your brain will hurt) https://www.wikidata.org/wiki/User:Ricordisamoa/ScriptTranslator.js

This is part of the featureset of Gadgets 2.0 (which is coming real soon now™).

An oldie!

Here's one of my attempts: (do not ever look at it, or your brain will hurt) https://www.wikidata.org/wiki/User:Ricordisamoa/ScriptTranslator.js

Page deleted? (Yeah I tried to look anyway :P)
Wait, that was a clickbait!

mediawiki.jqueryMsg already supports PLURAL, no need to reinvent it.
I don't know how it's been implemented in Gadgets 2.0, but a proper solution would likely make use of the Translate extension.

In T110633#1582932, @NiharikaKohli wrote:

An oldie!

Here's one of my attempts: (do not ever look at it, or your brain will hurt) https://www.wikidata.org/wiki/User:Ricordisamoa/ScriptTranslator.js

Page deleted? (Yeah I tried to look anyway :P)
Wait, that was a clickbait!

How it looked like:

ScriptTranslator.png (114×595 px, 12 KB)

Adding I18n as this is about i18n.

In T110633#1582925, @NiharikaKohli wrote:

if all the gadgets were centralized to Meta/elsewhere.

T1238: Central Code Repository for code used on wikis (Templates, Lua modules, Gadgets)

Just for reference, apparently some gadgets are currently using a system similar to https://www.wikidata.org/wiki/MediaWiki:Gadget-Merge.js.

Originally, a central repository of gadgets was part of the proposals for Gadgets 2.0¹, but I don't know if that is still the plan.

¹ https://www.mediawiki.org/wiki/Extension:Gadgets/Roadmap#Gadgets_2.0

Wikimedia Commons’s Watchlist messages Wizard is internationalised using the Translate extension.

kaldari triaged this task as Medium priority.Sep 11 2015, 5:23 PM
kaldari moved this task from Blocked to Older: Team Work on the Community-Tech board.
kaldari set Security to None.
kaldari raised the priority of this task from Medium to High.Sep 11 2015, 5:42 PM
kaldari updated the task description. (Show Details)
kaldari moved this task from Older: Team Work to Ready on the Community-Tech board.

TL;DR: If/when Gadgets 2.0 is finished, a separate implementation of gadget i18n will be yet another implementation.

What's the status of Gadgets 2.0 and how much overlap is there?

According to @Legoktm, Gadgets 2.0 has been ~80% complete for quite awhile. See T31272 for the tracking bug. The overlap is basically complete--Gadgets 2.0 will have an integrated l10n/i18n system.

Questions to answer:

  • How would such an i18n system work?
    • "Aside from the title (eg. MediaWiki:Gadget-foobar) and the description (eg. MediaWiki:Gadget-foobar-description) a gadget can have a number of custom made messages. These are handled by the existing system present in MediaWiki which is suited for this already and are loaded through the messages framework in ResourceLoader (associated at module registration and passed to the browser through mw.loader.implement / mw.messages.set)." (from https://www.mediawiki.org/wiki/RL2#Messages)
  • What would be its limitations? For example, could it support grammar features like plurals, gender, etc.?
    • It could support everything that other MediaWiki messages do.
  • How would translations be solicited?
    • Potentially, through associated TranslateWiki projects. If not, the new gadget userrights should make it easier to find someone with the appropriate permissions to update the messages.
  • How much work would be involved in implementing it as a proof-of-concept?
    • Unclear. It's a considerably more involved project than a simple i18n framework, but considerable work has been done on it already, including much discussion/planning. @DannyH points out that it doesn't look like any UI planning has been done (wireframes, etc.) for the various end users.
    • This will also take implementation discussions on specific project wikis regarding how to assign userrights, etc.

More links:

https://www.mediawiki.org/wiki/User:Legoktm/Gadgets_2.0_Audit
https://www.mediawiki.org/wiki/ResourceLoader/Version_2_Design_Specification
https://www.mediawiki.org/wiki/Extension:Gadgets/Roadmap
https://www.mediawiki.org/wiki/RL2

kaldari moved this task from In Development to Q1 2018-19 on the Community-Tech-Sprint board.