Right now, there's two message systems, one in mediawiki.js that basically just handles dollar-sign replacements, and an increasingly sophisticated one in jqueryMsg that tries to emulate the server. To make it more complicated, jqueryMsg monkey-patches mediawiki.js.
What do people think about merging them together, keeping mediawiki.js as the entry point? mediawiki.js already has the APIs that match the server. They just don't work anything like the server without jqueryMsg.
The jqueryMsg module could be kept as a redirect module like mediawiki.action.watch.ajax.
The only real downside is the bandwidth (but increasing numbers of modules are depending on jqueryMsg already), and potentially (depending if we keep the "fast path" exception) a small performance cost.
But done right I think it would significantly simplify documentation and (especially) unit testing.
Matt Flaschen
On Thursday, March 7, 2013, Matthew Flaschen wrote:
What do people think about merging them together, keeping mediawiki.js as the entry point? mediawiki.js already has the APIs that match the server. They just don't work anything like the server without jqueryMsg.
Mail thread discussing this topic in the past http://www.mail-archive.com/wikitech-l@lists.wikimedia.org/msg46732.html
Thanks Santhosh
And to make things even more interesting, now there's also jQuery.i18n, which has similar functionality: https://github.com/wikimedia/jquery.ime/
It's a library that provides the same message syntax and grammar / gender / plural features, but is more portable (independent of MediaWiki).
It's already used for parts of the UniversalLanguageSelector extension, to make them as portable as possible. There are no current solid plans to make wider use of it in MediaWiki, but I'd love to see it replace as much of our messages system as possible. There are some technical challenges - the message file format is different (essentially JSON), the way the files are loaded is different, and the application of messages to the page is different. Some changes in ResourceLoader will probably be needed to make it robust and easy to use in the rest of MediaWiki.
-- Amir Elisha Aharoni · אָמִיר אֱלִישָׁע אַהֲרוֹנִי http://aharoni.wordpress.com “We're living in pieces, I want to live in peace.” – T. Moore
2013/3/7 Santhosh Thottingal santhosh.thottingal@gmail.com:
On Thursday, March 7, 2013, Matthew Flaschen wrote:
What do people think about merging them together, keeping mediawiki.js as the entry point? mediawiki.js already has the APIs that match the server. They just don't work anything like the server without jqueryMsg.
Mail thread discussing this topic in the past http://www.mail-archive.com/wikitech-l@lists.wikimedia.org/msg46732.html
Thanks Santhosh _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
2013/3/7 Amir E. Aharoni amir.aharoni@mail.huji.ac.il:
And to make things even more interesting, now there's also jQuery.i18n, which has similar functionality: https://github.com/wikimedia/jquery.ime/
Sorry,
the right URL is https://github.com/wikimedia/jquery.i18n
On 03/06/2013 10:13 PM, Amir E. Aharoni wrote:
It's already used for parts of the UniversalLanguageSelector extension, to make them as portable as possible. There are no current solid plans to make wider use of it in MediaWiki, but I'd love to see it replace as much of our messages system as possible. There are some technical challenges - the message file format is different (essentially JSON), the way the files are loaded is different, and the application of messages to the page is different. Some changes in ResourceLoader will probably be needed to make it robust and easy to use in the rest of MediaWiki.
That's probably a longer horizon idea. If it were done, though, we should be careful not to make it harder to have messages used on both client and server.
Matt Flaschen
wikitech-l@lists.wikimedia.org