https://bugzilla.wikimedia.org/show_bug.cgi?id=38280

--- Comment #4 from Krinkle <[email protected]> 2012-07-21 02:28:59 UTC ---
(In reply to comment #3)
> I just wanted to notice that ResourceLoader (particularly,
> mw.loader.load/using) lacks this feature. For example, some gadgets, also
> scripts loaded via mw.loader.load, could use messages from MediaWiki: 
> namespace
> (via MediaWiki:Gadgets-definition and mw.loader.load call arguments)

As I said before, the infrastructure is all there. These 3 lines of code will
make it slightly easier but implementing that would still add the requirement
that the user loads this new module (the mediawiki.api.messages module) first.
So the benefit is minor, but I don't object it. If you want to write or need
help writing a patch, I'm happy to do that and will gladly merge it into core.

Regarding the ability to use mediawiki namespace messages in modules. This is
not true. ResourceLoader is designed with localization at heart from the every
beginning. Modules are constructed of mainly three resources:
* scripts
* styles
* messages

All of these are primary "citizens" in the module universe of ResourceLoader.

However, when working with ResourceLoader modules built from *Gadgets* (as
opposed to server-side defined modules), then you are correct that there is no
way to tell ResourceLoader about the messages that are needed. But, it is
important to note that this is a missing feature in Gadgets, not
ResourceLoader. The server-side infrastructure in ResourceLoader for messages
is pretty elaborate and bullet-proof. It's  much than passing an array of
message keys to the loader. In ResourceLoader the messages are primary citizens
and associated with the module itself, so there is no need to specify this at
loading time. Instead, it is taken care in advance and all you need to do is
call the module by its name (e.g. mw.loader.using( 'ext.foo.bar' )) which will
automatically fetch the scripts, styles and messages associated with that
module (usually cached already).

The Gadgets extensions just doesn't make use of this yet, and that is a
different issue all together. The way this could be done for gadgets is to add
syntax like [messages=monday,tuesday,hello-whatever] to the definition page.

Right now the Gadgets extension is being rewritten from scratch to make use all
of the great features that ResourceLoader provides. The progress of this
rewrite is very far and expected to be finished within a few weeks or months.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- 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
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to