Page MenuHomePhabricator

rl2.wmflabs.org: RL executes the module before the i18n messages are available
Closed, ResolvedPublic

Description

If a gadget try to use a message as soon as it starts its execution, the translated text is not available. Take a look at the example above. Its definition is at
http://rl2.wmflabs.org/rl2-repo1/w/index.php?title=Gadget_definition:test.js&oldid=466
and includes "messages":["about"]. Nonetheless, when it prints the value of mw.msg('about'), I get "<about>". A few seconds later, if I use mw.msg('about') again, it return the correct value: "About".

I tested on Ubuntu 12.04 using Google Chrome 21.0.1180.57. Same problem on Firefox 14.0.1.


URL: http://rl2.wmflabs.org/rl2-repo1/w/index.php?title=Gadget:Test.js&oldid=469
Screenshot of the console after the two attempts to get the translated message

bug.png (542×866 px, 101 KB)

Details

Reference
bz39027

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:56 AM
bzimport set Reference to bz39027.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 10930
Same problem on Firefox 14

Attached:

Same_problem_on_firefox_14.0.1.png (532×1 px, 123 KB)

Unclear whether this is a regression, mediawiki core related, Gadgets 2.0 related or ResourceLoader related.

Setting unconfirmed and blocking RL2.

DannyH set Security to None.
DannyH subscribed.

For CommTech: We should test this after these tickets are done:

T106177: Implement Gadget and Gadget definition namespaces plus their content models
T31398: Implement Gadget Manager

Legoktm expects that this is already fixed; we just need to make sure, and close the ticket.

kaldari claimed this task.
kaldari subscribed.

rl2.wmflabs.org seems to no longer exist, but the bug seems to be fixed as of the current patchset in gerrit. You can test with the "Console" gadget at http://commtech.wmflabs.org/wiki/Gadget_definition:Console. I even set the Gadget to position:top and it still loaded the message correctly.