MediaWiki talk:Linkscount.js

From Wikidata
Jump to navigation Jump to search

Edit request[edit]

{{Editprotected}}

Can you please add Hebrew trasalation to the section "var translations" as well:

he: {
				linksCountText: 'קישורים: ',
				transclusionCountText: 'הכללות: ',
				fileLinkCountText: 'שימוש מקומי בקבצים: ',
				fileGlobalLinkCountText: 'שימוש גלובלי בקבצים: ',
				countText: 'ספירה',
				invalidTitleText: 'כותרת לא חוקית',
				serverErrorText: 'שגיאת שרת, לחץ כדי לנסות שוב',
				comma: ','

Geagea (talk) 10:23, 6 August 2019 (UTC)[reply]

✓ Done --Matěj Suchánek (talk) 09:17, 27 October 2019 (UTC)[reply]

Edit request[edit]

can you add please for sindhi wikipedia

sd: {
				linksCountText: 'ڳنڌڻا: ',
				transclusionCountText: 'نتيجو: ',
				fileLinkCountText: 'عام طور تي فائيل استعمال: ',
				fileGlobalLinkCountText: 'گلوبل فائل استعمال: ',
				countText: 'ڳڻپ',
				invalidTitleText: 'غلط عنوان',
				serverErrorText: 'سرور جي غلطي، ٻيهر ڪوشش ڪرڻ لاء ڪلڪ ڪريو',
				comma: '،'
},

Kaleem Bhatti (talk) 04:19, 4 November 2019 (UTC)[reply]

@Matěj Suchánek:
 Comment Pinging Matěj Suchánek will work only with a valid signature. —Tacsipacsi (talk) 22:05, 4 November 2019 (UTC)[reply]
✓ Done Please use {{Edit request}} for broader attention. --Matěj Suchánek (talk) 09:13, 7 November 2019 (UTC)[reply]

Internal server error unhandled client side[edit]

@Ebrahim: I tried to get the usage count for a template used on millions of pages, and the server responded with

{"#error":"Internal server error"}

(I don’t know if anything can be done server side, but that’s a separate issue. If you think there’s a chance, I can open an issue with details on GitHub.) The client got a TypeError: response.pagelinks is undefined in line 114. This should be presented to the user, maybe internationalized. The failure of the XHR itself should also be handled (e.g. if the server or the network simply goes away). —Tacsipacsi (talk) 10:37, 24 December 2019 (UTC)[reply]

Tacsipacsi: Oh, given the default labs provided error logs you are apparently hitting some issue with the replication itself, try to run this query SELECT COUNT(*) FROM templatelinks WHERE tl_namespace = 10 AND tl_title = 'Navbox'; with the template name (replace 'Navbox' with the template you are interested) in Quarry or if you own a labs account issue `sql commons` command to connect to the db. −ebrahimtalk 13:49, 24 December 2019 (UTC)[reply]
And oh let me see what I can do in the client side. −ebrahimtalk 13:52, 24 December 2019 (UTC)[reply]
Doneebrahimtalk 14:24, 24 December 2019 (UTC)[reply]
@ebrahim: Thanks, but the client-side error is still not handled (second parameter of jqXHR.then()). This is a relatively rare but probable condition (I simulated it by turning Wi-Fi off, but it can occur if one simply walks away from the Wi-Fi, accidentally pulls the network cable out, the ISP starts maintenance, Wikimedia starts maintenance and shuts the server down etc.). —Tacsipacsi (talk) 15:57, 24 December 2019 (UTC)[reply]
Tacsipacsi: No problem, fixed :) −ebrahimtalk 19:17, 24 December 2019 (UTC)[reply]

URL change[edit]

{{Editprotected}}

@ebrahim: I’m glad you implemented the notification about network errors, because that’s exactly what happens at all requests now—Wikimedia started issuing 308 redirects from https://tools.wmflabs.org/linkscount/ to https://linkscount.toolforge.org/, and these redirects don’t include the Access-Control-Allow-Origin header, so the user agent rejects all requests. The easiest fix is changing the URL at line 107 ASAP from '//tools.wmflabs.org/linkscount/' to 'https://linkscount.toolforge.org/' (hardcoding the HTTPS scheme never hurts); it probably could be fixed on Wikimedia side, but that may have security implications at other tools. Thanks in advance, —Tacsipacsi (talk) 14:28, 7 July 2020 (UTC)[reply]

Tacsipacsi: Sure, I've used the new URL scheme elsewhere, done :) −ebrahimtalk 14:35, 7 July 2020 (UTC)[reply]
@ebrahim: Thanks! I happened to test the new version on c:Special:WhatLinksHere/Template talk:Wikidata Infobox—I no longer get server errors, but it returns constant zero, while this is clearly not true, as more than fifty pages are listed there. After some debugging, I found out that it doesn’t recognize the namespace, so the SQL query is pl_namespace = 0 AND pl_title = 'Template_talk:Wikidata_Infobox'. I think the easiest and least error-prone bug fix is using mw.Title, so I rewrote the script to make use of it (most of the rewrite is performance improvement, so that only parts actually interacting with the DOM wait until DOM is ready). Feel free to delete my subpage after incorporating my changes in this page. —Tacsipacsi (talk) 23:58, 7 July 2020 (UTC)[reply]
Tacsipacsi: Sure! Look nice! Added you to the author section also :) −ebrahimtalk 06:45, 8 July 2020 (UTC)[reply]

sv translation[edit]

{{Editrequest}}

			sv: {
				linksCountText: 'länkar: ',
				transclusionCountText: 'inkluderingar: ',
				fileLinkCountText: 'lokal filanvändning: ',
				fileGlobalLinkCountText: 'global filanvändning: ',
				countText: 'antal',
				invalidTitleText: 'ogiltig titel',
				serverErrorText: 'serverfel, klicka för att försöka igen',
				comma: ','
			},

--Sabelöga (talk) 01:32, 26 July 2021 (UTC)[reply]

✓ DoneMisterSynergy (talk) 21:16, 14 October 2021 (UTC)[reply]

Russian translation/Перевод на русский язык[edit]

{{Edit request}}

Hi, could you please add the following translation in Russian to the code as well?

		ru: {
			linksCountText: 'ссылок: ',
			transclusionCountText: 'включений: ',
			fileLinkCountText: 'локальных использований файла: ',
			fileGlobalLinkCountText: 'глобальных использований файла: ',
			countText: 'посчитать',
			invalidTitleText: 'некорректное название',
			serverErrorText: 'ошибка сервера — нажмите, чтобы повторить запрос',
			comma: ','
		},

Pacha Tchernof (talk) 23:28, 18 February 2022 (UTC)[reply]

✓ Done --Matěj Suchánek (talk) 15:26, 6 May 2022 (UTC)[reply]
@Matěj Suchánek, Thank you. — Pacha Tchernof (talk) 15:28, 6 May 2022 (UTC)[reply]

ep[edit]

{{Ep}}

@@ -116,7 +116,7 @@
 		}).click(function (e) {
 			e.preventDefault();
 			finished = true;
-			var title = mw.Title.newFromText($('#mw-whatlinkshere-target, input[name=target]').val());
+			var title = mw.Title.newFromText($('#mw-whatlinkshere-target > input[name=target]').val());
 			if (title === null) {
 				mw.notify(messages.invalidTitleText);
 				return;

Fix the selector issue after phab:T117754 got resolved. Stang 01:11, 3 June 2022 (UTC)[reply]

Already fixed by Nikki. Stang 07:49, 17 June 2022 (UTC)[reply]

Server side breakage that just fixed[edit]

The tool had server-side breakage due to changes in MediaWiki tables, https://phabricator.wikimedia.org/T312666 to be more specific, please ping me if got broken again as other involved tables are going to be changed. Thanks −ebrahimtalk 09:00, 24 September 2022 (UTC)[reply]

@ebrahim: Almost fixed, see https://github.com/ebraminio/linkscount/pull/3. By the way, while checking the backend fix, I noticed that the frontend has also been broken: if I change the selected namespace, it no longer offers me to refetch the results. Neither does it if I select a new title without actually typing anything (but rather by clicking in the title field and selecting a title from the dropdown). This is probably connected to the recent OOUIfying of the special page, could you please take a look at it? Thanks in advance! —Tacsipacsi (talk) 22:17, 24 September 2022 (UTC)[reply]
Tacsipacsi: Fantastic, just applied your patch! But has one little issue regarding use `?int` in labs' PHP. True, that OOUIfying probably has broken that part. −ebrahimtalk 22:29, 24 September 2022 (UTC)[reply]

Global use of Wikimedia Commons data[edit]

Is there some way to check global usage of Wikimedia Commons data files, like seeing where https://commons.wikimedia.org/wiki/Data:Wikipedia_statistics/data.tab is used (I'm aware of its uses in at least two different wikis), so we can add its number in this tool also? −ebrahimtalk 04:32, 11 November 2022 (UTC)[reply]

It looks like mw:Extension:JsonConfig uses standard API requests to get data from Commons, so Commons has no information about the current request coming from JsonConfig, let alone the originating wiki or page. I don’t see traces of per-wiki storing of the pages accessing a particular data file, either, so probably the only solution is an all-wiki full-text search, which of course will miss a lot of usages due to string concatenation and similar issues. 🙁 —Tacsipacsi (talk) 22:57, 13 November 2022 (UTC)[reply]