- Is it possible to get multiple language versions in a single request? It seems that the API immediately falls back to English if the requested language isn't available. I would like to be able to created a longer fallback chain that tries the page language and the the wiki language before using English. I know I could do this by separate requests but is there a way to do this in a single request?
- How would you decode HTML entities without using the DOM? I am looking for the inverse of mw.html.encode. I have searched online other places and can only find the following type of solutions.
- Use JQuery and the DOM - I already did this for one of my other scripts but people on other sites are saying it is not advisable because it relies on browser-specific behavior
- Use someone else's library/function - I doubt Wikia would have it
- Write your own function - seems like this should not be necessary
ALL POSTSGetting and Using System Messages
<p>So, I already know in general how to do this, but I have the two following questions:
</p>
(Edited by Andrewds1021)
- nope. but here is i18n-js
- you don't need it, msg is not encoded. it is encoded for your eyes, when rendered as a text. the real one: &format=json use $.getJSON(url) to get the message. the real structure.
(Edited by Fngplg)
<p>I see. Thanks for the info. I was planning on using mediawiki.api to get the message; not sure if that would be any different from what you get with $.getJSON; but I guess I can just try it and see.
</p>
(Edited by Andrewds1021)
<div class="aquote" style="border-width:1px;border-style:ridge;"><span class="aquote-user">Andrewds1021</span><span class="aquote-msgid" style="float:right;">#3</span><div class="aquote-msg">not sure if that would be any different from what you get with $.getJSON</div></div><p></p>.get is always here, when mw.api might be not loaded at some time, so u will have to load it by urself.
(Edited by Fngplg)
<p>I see. Although, from what I can tell, that saves me from only 1 additional deferred object (waiting for it to mw.api to load). I am not convinced that makes much of a difference given that everything after that needs to be chained anyways.
</p>
(Edited by Andrewds1021)