FlominatorTM / wikiblame

http://wikipedia.ramselehof.de/wikiblame.php
GNU General Public License v3.0
54 stars 13 forks source link

Support wikis without subdomains #40

Closed waldyrious closed 2 years ago

waldyrious commented 2 years ago

Some wikis do not have a subdomain, and even using "www" fails because they don't have the redirect set up — for example, https://translatewiki.net. Currently I can't use wikiblame on such wikis because the subdomain defaults to "en" if I leave it empty.

It would be nice if the lang parameter didn't automatically default to the user language if it's explicitly left empty:

https://github.com/FlominatorTM/wikiblame/blob/d176e27fba844681fbc78e365c2e9bb9645375e1/shared_inc/wiki_functions.inc.php#L16-L19

Since it's already pre-filled when we open the tool page, I don't think removing the fallback behavior would be detrimental to the experience of people who would indeed want to use their UI language as the subdomain.

If there's no objection to this change, I'd be happy to submit a PR.

FlominatorTM commented 2 years ago

In theory sounds like a good idea, although I'm a bit worried, how my other tools would react, which also use wiki_functions.php

Maybe one could only default it, if $project is wikipedia, wikisource etc.?

waldyrious commented 2 years ago

Maybe one could only default it, if $project is wikipedia, wikisource etc.?

Good point. Sounds reasonable to me. Would you like me to submit a PR?

FlominatorTM commented 2 years ago

It would at least increase the chance of fast implementation and deployment like crazy ;)