Last modified: 2011-05-02 12:15:12 UTC
Created attachment 8306 [details] pt-BR bug Here are the steps to reproduce the bug: 1) Log in an account having 'pt-br' as user lang on pt.wikipedia.org (or just add &uselang=pt-br to the url of the 3rd step). I did this using Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16pre) Gecko/20110310 Ubuntu/10.10 (maverick) Namoroka/3.6.16pre. 2) Go to an article of English Wikipedia. I went to "Test". 3) Click in the bookmarklet and In the next screen, select "Português" in the list, and type some title for the new article. I typed "TestPagePt". The script will open the URL above. After the page is loaded: 4) Click again in the bookmarklet[1] and the script will look for something from 'pt-br.wikipedia.org'. See the screenshot. PS: Nothing else happens after this (probably because there is nothing on pt-br.wikipedia...) and there is no console errors.
Created attachment 8307 [details] Bokmarklet code [1] The current bookmarklet code
In the error console of Chrome (10.0.648.134) I see this error: GET http://pt-br.wikipedia.org/w/api.php?action=query&prop=info&inprop=protection&titles=TestPagePt&format=json&callback=jsonp1300364412360 undefined (undefined)
i checked the details shared above and was able to recreate the issue. after doing some debugging, i saw that if the userlang URL parameter is available then wikipedia updates the wgUserLanguage parameter as the userlang URL parameter. since we are using wgUserLanguage parameter to determine to which wikipedia api to call. hence the script is making calls to pt-br.wikipedia.org api and failing. we will work on this.
the issue is resolved with r-87245. previously we were using the user language as the translation language. now we are considering the article content language as the translation language