MediaWiki talk:GoogleOCR.js
Unknown languages[edit]
{{editprotected}} The script doesn't run for language codes unknown for Google: es. nap, the language code for neapolitan. Some more rows of code could solve the problem for Italian minor languages:
var lang = mw.config.get( 'wgContentLanguage' ); if (["nap","vec","pms"].indexOf(lang)!==-1) { lang="it"; }
--Alex brollo (talk) 11:10, 3 September 2019 (UTC)
- @Alex brollo: Sounds like a good idea. I'd make the change, but I don't have rights here to do so. I've added the editprotected template above. —Sam Wilson 11:58, 3 September 2019 (UTC)
- @Samwilson: I just tested the modified code into nap.wikisource and it runs. --Alex brollo (talk) 12:26, 3 September 2019 (UTC)
- @Alex brollo, Samwilson: Done! Let me know if something is not working, I don't use this script myself. Jon Harald Søby (talk) 19:29, 25 February 2020 (UTC)
- @Samwilson: I just tested the modified code into nap.wikisource and it runs. --Alex brollo (talk) 12:26, 3 September 2019 (UTC)
Button formatting[edit]
{{editprotected}} Could someone change the width of the button from 42px to something like 44 or 45px instead? The actual image is 47px wide and it gets cropped on my browser unless set to at least 43px. The relevant code is on line 70. Kaldari (talk) 18:54, 25 February 2020 (UTC)
- Pinging some admins, as it seems no one (with adequate permissions) is responding to edit requests here. @Yann, Jon Harald Søby:. Kaldari (talk) 19:01, 25 February 2020 (UTC)
Toolforge URL[edit]
{{editprotected}}
Could someone please update the script and change
var toolUrl = "//tools.wmflabs.org/ws-google-ocr/api.php";
to
var toolUrl = "https://ws-google-ocr.toolforge.org/api.php";
? Thanks! Sam Wilson 08:53, 8 July 2020 (UTC)
- Sam, Should I add
https:
? Most of the time for best practise, I saw//
.--Jayprakash (talk) 09:06, 8 July 2020 (UTC)- @Jayprakash12345: No, it's fine without. :-) It doesn't really change anything, because no one will be loading the gadget from http:// anyway, so the protocol relativeness isn't really required. Sam Wilson 09:08, 8 July 2020 (UTC)
- Sam, Should I add
labelMsg: to mw.msg()[edit]
@Jon Harald Søby: Whence comes the labelMsg:
deprecation? cf. this edit. I couldn't find any notice of anywhere.
In any case, the code…
var ocrButtonDetails = {
type: 'button',
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/bd/GoogleOcr_WikiEditor_button.png',
labelMsg: 'google-ocr-button-label',
action: { type: 'callback', execute: doOcr }
};
…needs to change to…
var ocrButtonDetails = {
type: 'button',
icon: 'https://upload.wikimedia.org/wikipedia/commons/b/bd/GoogleOcr_WikiEditor_button.png',
label: mw.msg('google-ocr-button-label'),
action: { type: 'callback', execute: doOcr }
};
This Gadget is cross-laded to enWS and generating console messages for users there. Xover (talk) 06:21, 29 August 2023 (UTC)