Tech/Archives/2021

From Meta, a Wikimedia project coordination wiki
< Tech‎ | Archives
Jump to navigation Jump to search

Feature of PLURAL in Turkish language

Hello,

Some translation pages have the PLURAL feature/plugin, but there is no need to use this feature in Turkish language because when a number comes in front of a noun, the noun does not get a plural. However, the interface does not acknowledge this and sees it as an untranslated or incomplete translation. This problem needs to be corrected in Turkish translations. But page gives warning as "{{PLURAL:}} has duplicate forms at the end." You have to remove this warning for Turkish language.

For example;

in English {{PLURAL:$votes|$votes support vote|$votes support votes}} means "1 support vote" or "2 support votes". This is correct use for English.

in Turkish {{PLURAL:$votes|$votes destek oyu|$votes destek oyu}} means "1 destek oyu" or "2 destek oyu". We can't make it plural ({{PLURAL:$votes|$votes destek oyu|$votes destek oyları}} is wrong use) (for usage, you can see in this page) --Cemallamec (talk) 12:24, 15 January 2021 (UTC)

@Cemallamec: You can simply drop the second parameter: {{PLURAL:$votes|$votes destek oyu}}. This will result in the first (and only) parameter for any number. —Tacsipacsi (talk) 18:17, 15 January 2021 (UTC)
@Tacsipacsi:, thank you. This works! --Cemal (talk) 09:33, 16 January 2021 (UTC)

Suggestion: Can the wonderful hover capability in Wikipedia be improved so that when you hover over a link to a disambiguation page you see some of the disambiguation page content instead of merely a sentence mentioning that it contains items? This is a suggestion for action, not a question to be answered. Thank you!

Suggestion: Can the wonderful hover capability in Wikipedia be improved so that when you hover over a link to a disambiguation page you see some of the disambiguation page content instead of merely a sentence mentioning that it contains items? This is a suggestion for action, not a question to be answered. Thank you!--2604:2D80:CC0F:0:44F6:A56E:4198:E291 17:34, 22 January 2021 (UTC)

Code not working on some pages

Hi, I am working on this code.

It do work (I tested it on itwiki) on talk pages (example) and on Special:Contributions; it does not work on ns0 and some special pages such as Special:Watchlist.

The error occours when I try pressing the button I've just created (in p-personal); there is something going wrong when trying to create a dialog.

The error I get on ns0 is the following one

Uncaught TypeError: Cannot read property 'Dialog' of undefined
    at HTMLLIElement.<anonymous> (todo.js?action=raw&ctype=text/javascript:61)
    at HTMLLIElement.dispatch (load.php?lang=it&modules=jquery&skin=vector&version=tqh7e:69)
    at HTMLLIElement.elemData.handle (load.php?lang=it&modules=jquery&skin=vector&version=tqh7e:66)

While in Special:Watchlist:

Uncaught Error: inheritClass: Origin is not a function (actually undefined)
    at Object.OO.inheritClass (<anonymous>:391:54697)
    at HTMLLIElement.<anonymous> (todo.js?action=raw&ctype=text/javascript:61)
    at HTMLLIElement.dispatch (load.php?lang=it&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|mediawiki.rcfilters.filters.ui&skin=vector&version=14e8x:69)
    at HTMLLIElement.elemData.handle (load.php?lang=it&modules=jquery%2Coojs-ui-core%2Coojs-ui-widgets|mediawiki.rcfilters.filters.ui&skin=vector&version=14e8x:66)

I tryied manually importing some scripts, since it seems that it does not recognize OO.ui.Dialog, but it keep being broken.

Can someone help me? Thank you--ValeJappo【〒】 15:20, 25 January 2021 (UTC)

@ValeJappo: I've skimmed through the script, the first and foremost thing that comes to mind is that it's manually loading OOUI modules in a way that is 1) Not supported (in that it's error-prone, because you're directly using the module names), 2) Not working, because you're generating script tags, but not appending them to the DOM. The correct way to do this is to use the appropriate ResourceLoader methods to import the relevant OOUI modules (probably oojs-ui-core and oojs-ui-widgets). All of this is going to be async so you need a callback to run your code after the modules have been loaded. The reason why the script is currently working on some pages but not other is that some other JS code (might be a userland script or a MW script) is already importing OOUI modules before your script runs, which is basically random. --Daimona Eaytoy (talk) 15:33, 25 January 2021 (UTC)
@Daimona Eaytoy: thank you, I figured out how to load all modules in a right way:
mw.loader.load( 'oojs-ui-core' );
mw.loader.load( 'oojs-ui-widgets' );
mw.loader.load( 'oojs-ui-toolbars' );
mw.loader.load( 'oojs-ui-windows' );
ValeJappo【〒】 15:56, 25 January 2021 (UTC)
@ValeJappo: It's still not enough, the mw.loader.load calls are asynchronous, and there's no guarantee that they'll have completed by the time the script tries reading OOUI stuff. The right thing to do this is to use mw.loader.using (see link above), and run your code that depends on OOUI inside the success handler for the promise returned by the mw.loader.using call. --Daimona Eaytoy (talk) 16:34, 25 January 2021 (UTC)

en:Template:Val equivalent for cswiki

Hello tech experts, would you know if there is a Czech Wiki equivalent for a template en:Template:Val? Whom to ask? How to find out? Many thanks, KPX8 (talk) 18:40, 25 January 2021 (UTC)

This template is only a shell. All program code is in en:Module:Val. You need to translate it into Czech. Ruslik (talk) 20:48, 27 January 2021 (UTC)

Starting the Wikimedia Rust developers user group

Hi everyone,

We are starting a user group for people interested in spreading the adoption of the Rust programming language in the Wikimedia movement. If you're not familiar with it, Rust is a systems programming language that aims to provide the trifecta of safety, concurrency and speed. It's very fun to use (rated #1 favorite language in Stack Overflow's survey 5 years and counting) and has fantastic tooling.

If you're already using Rust or looking to get started - please sign up!

The current proposed goals of the user group are:

  • Develop a rich toolkit of Rust libraries and applications for working with Wikimedia and MediaWiki projects and APIs
  • Make Rust a first-class language in Wikimedia infrastructure like Toolforge
  • Encourage the usage of Rust where appropriate to build safer and better tools
  • Assist others who end up encountering Rust and need help (e.g. when upstreams adopt Rust)
  • Mentor new developers who are interested in contributing technically to the Wikimedia movement, including through programs like GSoC and Outreachy

Have other ideas of what we could do? Please suggest them on the talk page!

Legoktm (talk) 07:50, 12 February 2021 (UTC)

API query in Polish language

Hi,

I'm trying to get a result like the one here:

https://codepen.io/malavender/pen/qdvMyO

but when swapping the API URL to 'pl.' and query titles to ex. 'Szczęście' (Happiness), I get nothing. Tried using UTF-16 encoding (Szcz%C4%99%C5%9Bcie) to avoid diacritics, but that fails, too.

Can anyone advise? I'd just like to be able to list some topics, like the codepen author does on line 7 of his .js script.

Best regards, bo —The preceding unsigned comment was added by Bonobonoxyz (talk) 12:24, 12 February 2021 (UTC)

Bonobonoxyz, is the API response also empty or only the final result? English and Polish Wikiquote probably use different formats of templates, so you need to rewrite response parser to accommodate that. There is a proposal of Structured Wikiquote and I very much hope that in the future we will have it, then something as simple as getting a list of quotes will be a trivial task, but at the moment it is what it is. P.S. Please use four tildes, ~~~~, to sign. --Base (talk) 13:14, 12 February 2021 (UTC)
The language here is not an issue, it's more a matter of what you're trying to do. From your code I see you're trying to use the mw:Extension:TextExtracts, which is better than trying to do all the parsing yourself, but what do you expect to get from it? What are you trying to accomplish? How did you determine that's the best API for the purpose? From what I can tell, it's working as expected: https://pl.wikiquote.org/w/api.php?action=query&prop=extracts&exsectionformat=plain&titles=Szcz%C4%99%C5%9Bcie
The API does very little work for you, don't expect to have anything that works consistently across languages. I wonder if maybe it would be helpful to consider the matter more generally: mw:API:Parsing wikitext, mw:Extension:FeaturedFeeds. Nemo 19:05, 12 February 2021 (UTC)

Technical maintenance planed‬

Translating Wikimedia portals

I want to translate https://www.wikibooks.org/, https://www.wikiversity.org/, https://www.wikivoyage.org/, https://www.wikinews.org/, https://www.wikiquote.org/ and https://www.wiktionary.org/ in Romanian, but I do not know where I can do that. Also, I already translated https://www.wikipedia.org/ on translatewiki in Romanian, but the translations are still not live. --NGC 54 (talk / contribs) 10:51, 22 February 2021 (UTC)

@NGC 54: Hi, looks like the last "Localisation updates from https://translatewiki.net" was merged into the codebase seven days ago. The codebase then gets copied (deployed) on the servers usually once a week (if all goes well). So things can take up to two weeks in total. When did you finish the translations? --AKlapper (WMF) (talk) 15:23, 22 February 2021 (UTC)
For general info and context: Project portals. --AKlapper (WMF) (talk) 15:26, 22 February 2021 (UTC)
@AKlapper (WMF): 35 messages on 6 February 2021, 2 messages on 17 February 2021 and 4 messages on 20 February 2021. None of these messages are live. --NGC 54 (talk / contribs) 17:49, 22 February 2021 (UTC)
Are you sure? I just randomly checked https://translatewiki.net/wiki/MediaWiki:Wikibase-sitelinks-wikiversity/ro and it's on https://www.wikidata.org/wiki/Q80699535?uselang=ro. Stryn (talk) 08:21, 23 February 2021 (UTC)
@Stryn: When I acces https://www.wikipedia.org/, I see "enciclopedia liberă" instead of "Enciclopedia liberă" (https://translatewiki.net/w/i.php?title=Wikimedia:Portals-wiki.slogan/ro&action=history); I see "Wikipedia is hosted by the Wikimedia Foundation, a non-profit organization that also hosts a range of other projects." instead of "Wikipedia este găzduită de Wikimedia Foundation, o organizație non-profit care găzduiește de asemenea o varietate de alte proiecte."... --NGC 54 (talk / contribs) 11:33, 23 February 2021 (UTC)
I also still see the old translation (I had to dig into my browser preferences as it doesn’t seem to be a way to change the display language on www.wikipedia.org…), even though the change appeared in Git almost two weeks ago now. No idea what’s going on. —Tacsipacsi (talk) 14:38, 28 February 2021 (UTC)
@NGC 54 and Tacsipacsi: The portals are unlike the MediaWiki software, they have a separate manual deployment process: phab:T128546. Normally this happens on a Monday morning, but it appears to have been missed for a few weeks (I know one of those Mondays was a WMF holiday). A deployment did just happen this morning, and the Romanian translations appear to be live now. the wub "?!" 12:13, 1 March 2021 (UTC)
@The wub: The translations are live now. --NGC 54 (talk / contribs) 12:23, 1 March 2021 (UTC)

Template:LangSelect doesn't work with all language settings

Hope this is the correct place to report this, if not please forward: Template:LangSelect displays nothing if the language is set to for example de-CH. Would also be nice if it'd fall back to de or even en or any other available language to at least display something instead of just nothing, or maybe give a hint about the selection box at the very top of the page if the current language isn't translated for some text. --Nenntmichruhigip (talk) 13:28, 3 March 2021 (UTC)

Strings to translate not updated for Wikimedia Endowment

Hello, Strings to translate for Wikimedia Endowment has not been updated since a year, is there something we can do to update them ? Thanks Jona (talk) 17:22, 5 March 2021 (UTC)

@Jona: Translations need to be pushed manually by a translation administrator, because it’s difficult to get the translation syntax right, so a human review is often necessary. If you’re lucky, we notice pages in need for pushing after some time, but you can reach out at Meta talk:Babylon if you’re impatient. (I pushed this page for translation now.) —Tacsipacsi (talk) 02:05, 6 March 2021 (UTC)
@Tacsipacsi: OK, thank you ! Jona (talk) 17:39, 7 March 2021 (UTC)

Where to specify the time format in block expire message in mobile?

We found that the format of the block expiry message in the mobile site is wrong in Finnish language (photo of the message). For example: "Block will expire in 10 months". 10 months is translated as "10 kuukauden", when it should be "10 kuukauden päästä" or something similar. Where to translate the "10 months", I think it's coming straight from some system message or the time function? Stryn (talk) 10:40, 9 March 2021 (UTC)

@Stryn: You can find the message ID of a string by using the uselang=qqx URL parameter. --AKlapper (WMF) (talk) 06:27, 17 March 2021 (UTC)
No I can't find the "10 months" from the system message, that's why I'm asking here. The system message before it is {{Int:Mobile-frontend-editor-blocked-drawer-expiry-header}} as I wrote above. I think the block expiry is coming from the time function or somewhere else. Stryn (talk) 07:24, 17 March 2021 (UTC)

citations dont show on pages

https://fa.wikipedia.org/wiki/اصفهان https://fa.wikipedia.org/wiki/tehran https://fa.wikipedia.org/wiki/%D8%B3%DB%8C%D8%AF_%D8%B9%D9%84%DB%8C_%D8%AE%D8%A7%D9%85%D9%86%D9%87%E2%80%8C%D8%A7%DB%8C Baratiiman (talk) 07:41, 17 March 2021 (UTC)

Problem with accented french characters sort

Hello, I have tried several things to resolve the problem I am having, but without success. My pages starting with É end up at the end of other pages, which is wikimedia's default sort order. How to sort, so that the É are considered as E? I tried to reenter the line mw.config.set ('tableSorterCollation', {'É': 'E', 'é': 'e', ​​'ä': 'ae', 'ö': 'oe', 'ß': 'ss' , 'ü': 'ue'}); in my common.js, but it doesn't work, just like I declared $ wgCategoryCollation = "uca-fr"; in my Localsettings.php, but it doesn't work either ... I have the same problem with words that are in capitals like AKTO, which are found before other words and therefore not well sorted ... Can you help me please ? Thank you very much. Benoit -- 07:08, 21 March 2021 (UTC)

Are you talking about a Wikimedia wiki or your own MediaWiki installation? What page content language are you using? Nemo 07:49, 21 March 2021 (UTC)

My own Mediawiki installation. I'm very sorry, I'm a beginner on Mediawiki. By the way, I don't know if I post my question in the good place for it...

It's a wiki for training organization in France because we have so many interlocutors that the small structures (like me), we are lost. You can see the problematic page here. At the start and at the end of the sort.

https://forma-wiki.fr/index.php/Sp%C3%A9cial:Toutes_les_pages

Thank you very much.

This page is for tech questions related to Wikimedia Foundation wikis, although sometimes people are kind enough to help those in need with other questions. A better target board might be mw:Project:Support desk. Killiondude (talk) 23:04, 21 March 2021 (UTC)

Reflinks down

Hi all. Reflinks have been down for about a week now which is impeding the ability to edit freely. Would anyone be able to assist with fixing it please? When you run it, the script comes up with:

<type 'exceptions.MemoryError'> Python 2.7.6:

Mon Mar 29 18:15:47 2021 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

/home/dispenser/public_html/cgi-bin/webreflinks.py in () 1489 <script src="/~dispenser/resources/reflinks.js" type="text/javascript"></script> 1490 """) => 1491 main() 1492 finally: 1493 wikipedia.endContent() main = <function main> /home/dispenser/public_html/cgi-bin/webreflinks.py in main() 1406 """) 1407 bot = ReferencesRobot(site, generator, always, limit or 20) => 1408 bot.run() 1409 1410 if __name__ == "__main__" and wikipedia.handleUrlAndHeader(): bot = <__main__.ReferencesRobot instance>, bot.run = <bound method ReferencesRobot.run of <__main__.ReferencesRobot instance>> /home/dispenser/public_html/cgi-bin/webreflinks.py in run(self=<__main__.ReferencesRobot instance>) 871 Runs the Bot 872 """ => 873 deadLinks = codecs.open(listof404pages, 'r', 'latin_1').read() 874 socket.setdefaulttimeout(30) 875 for page in self.generator: deadLinks undefined, global codecs = <module 'codecs' from '/usr/lib/python2.7/codecs.pyc'>, codecs.open = <function open>, global listof404pages = '404-links.txt', ).read undefined /usr/lib/python2.7/codecs.py in read(self=<open file '404-links.txt', mode 'rb'>, size=-1) 666 def read(self, size=-1): 667 => 668 return self.reader.read(size) 669 670 def readline(self, size=None): self = <open file '404-links.txt', mode 'rb'>, self.reader = <open file '404-links.txt', mode 'rb'>, self.reader.read = <bound method StreamReader.read of <open file '404-links.txt', mode 'rb'>>, size = -1 /usr/lib/python2.7/codecs.py in read(self=<open file '404-links.txt', mode 'rb'>, size=-1, chars=-1, firstline=False) 472 data = self.bytebuffer + newdata 473 try: => 474 newchars, decodedbytes = self.decode(data, self.errors) 475 except UnicodeDecodeError, exc: 476 if firstline: newchars undefined, decodedbytes undefined, self = <open file '404-links.txt', mode 'rb'>, self.decode = <built-in function latin_1_decode>, data = '$100,000 Challenge\thttp://thefoolsparadise.com/d...ts Applications to Theorem Proving\t404\tNot Found\n', self.errors = 'strict' <type 'exceptions.MemoryError'>: args = () message =

/home/dispenser/public_html/cgi-bin/tracebacks/webreflinks_MemoryError_1491_u3mvZh.html contains the description of this error.

If anyone can assist that would be great. The C of E (talk) 18:20, 29 March 2021 (UTC)

@The C of E: What are reflinks? How to reproduce somehow somewhere? Where's that output above from? Please provide some context. --AKlapper (WMF) (talk) 07:41, 30 March 2021 (UTC)
@AKlapper (WMF): Apologies, I thought everyone knew about the editing tool. It's something that automates the filling in of bare links in references. This is the tool here. At the moment if you try to run it on a page, you get the above code. It has been mentioned on the English Wikipedia's technical page as something that badly needs fixing. The C of E (talk) 07:45, 30 March 2021 (UTC)
Whoever operates the website at http://69.142.160.183 (probably Dispenser) needs to be contacted; as far as I understand that's not a Wikimedia domain/website (https://reflinks.toolforge.org/ would be). --AKlapper (WMF) (talk) 09:42, 30 March 2021 (UTC)

en.m.wiktionary Header sections always not collapsed and always expanded

This is on one of the biggest and oldest projects on Wikimedia.

On mobile site, the header sections which are usually collapsed on other wikis, always appear expanded on this wiki.

Our readers are complaining about this issue. Sections can be very long and always-expanded sections are hard to read. Links to a section don't position correctly, because the link first goes to the section, then all sections expand after that which makes useless the positioning that happens just before.

Would like guidance on what is causing this, and what can be done to correct this behavior. 119.56.97.84 17:35, 31 March 2021 (UTC)

Answer at wikt:Wiktionary:Grease pit/2021/March#Wiktionary:Information_desk/2021/March#Always_minimize_all_sections_(mobile_version) (I’d appreciated if you’ve given the link, though). —Tacsipacsi (talk) 19:46, 1 April 2021 (UTC)
@Tacsipacsi: So it was a change on Phabricator. Thank you very much for getting the decision for us. And also for visiting our forum (sorry that I did not think to bring it back).
For us, would need a look on how many pages this seriously affects (as a percentage), to decide if something needs to be done. I do note that it affected your reading wikt.
Mobile view has been more neglected even though more people are reading on mobile. It is sad when many editors still stay with desktop view because mobile view is still difficult to use. 119.56.100.135 07:05, 2 April 2021 (UTC)
If there is community consensus to change an existing configuration setting for a Wikimedia website, then please see Requesting wiki configuration changes how to proceed (plus include a reference to phab:T63447). Thanks! --AKlapper (WMF) (talk) 12:17, 2 April 2021 (UTC)

en.wiktionary Lua errors happen often on Long Pages

This is a big WM project.

Often on en:wiktionary:Special:LongPages, the pages on this list end up with Lua memory errors partway down the page.

It happens for some people and some times, and not for others. Quite often enough to be concerned.

Can the situation be improved? The community tech forum is at Project:Grease pit.

Thank you119.56.97.84 17:43, 31 March 2021 (UTC)

This sounds like phab:T165935 and phab:T267708. The situation can be improved by having shorter pages, more performed Lua modules, or maybe maybe by updating the Lua stack on Wikimedia servers (I'm not sure about the latter, would need investigation). --AKlapper (WMF) (talk) 12:13, 2 April 2021 (UTC)

Allowing interface admins to delete sitewide CSS/JS/JSON

On Chinese Wikipedia, interface admins are not required to be an admin. And we find that both user groups are needed to delete a CSS/JS/JSON page in MediaWiki namespace. That's weird. Since allowing admins to delete such pages seems impossible according to previous Phabricator tasks, is it reasonable if we allow interface admins to delete them? Here is the related discussion. Lt2818 (talk) 16:34, 7 April 2021 (UTC)

@Lt2818: The deletion right applies to all pages, so if you give interface administrators right to (un)delete CSS/JS pages, they will be able to do so with any other page: articles, help pages etc. (Normal admins should be able to (un)delete JSON pages, as they are considered to be safe.) I don’t know if system administrators are willing to do this, but if you voted on this (and not only on allowing them to do so with CSS/JS pages), then I don’t know why they would reject your request. (By the way, as far as I see, all but one interface administrators are administrators as well, so I don’t think this to be a serious issue.) —Tacsipacsi (talk) 23:34, 7 April 2021 (UTC)
@Tacsipacsi, adding further permissions to the interface-admin group is prohibited by the sysadmins according to Limits to configuration changes. I guess MediaWiki could be patched to further granularize deletion permissions and add a user right that lets users delete sitewide CSS/JS/JSON pages, assigning them to the interface-admin group globally. I am not a developer so I am not sure if that is desired, and if so, whether it'd be easy to do or a total pain. Best regards. —MarcoAurelio (talk) 11:06, 8 April 2021 (UTC)
@MarcoAurelio and Lt2818: Actually that document doesn’t state that interface editing rights should not be given to normal administrators, although I’m pretty sure that’s the case… Anyways, nothing there forbids the creation of a “deleter” user group, which could be given to interface admins who are not admins. Of course, the considerations about the lack of namespace restriction still stand.
I think it should possible to create a namespace-restricted deletion right (e.g. when this comment saying This code [i.e. the method responsible for the deletion form and authorization] desperately needs to be totally rewritten is resolved), but it will likely cause some headaches—for example, it’s not enough to control whether one can delete, it should also control whether one sees the delete tab, whether they can see deleted revisions with all their links, whether they can restore (links should be cared for here as well) etc. —Tacsipacsi (talk) 19:44, 8 April 2021 (UTC)
Interface admins were not intended to be a standalone group. They were thought of as admins with some additional rights. Ruslik (talk) 11:28, 8 April 2021 (UTC)
@Ruslik0: Why do you think so? Interface administrators doesn’t state anything like this. Also, before the introduction of interface admins, several wikis had an interface editor user group, which was exactly what interface admins are today—rights to edit all pages in the MediaWiki namespace, but no other admin rights. The two have simply nothing to do with each other except for both being highly trusted groups—normal admins mostly work with people (requests for deletions, blocks etc.), while interface administrators work with code. For example I happily do interface administrator tasks on huwiki, but I don’t want to become an admin (although I was asked several times), as I don’t want to take the responsibility of working with people at that level. —Tacsipacsi (talk) 19:44, 8 April 2021 (UTC)