Extension talk:Lingo/2023

Not showing tooltip for specific cases

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Implemented Lingo 3.1.2 (836982a) from distributor for 1.38.2. Works fine except cases when the string is followed by a space and a round bracket, such as vl is given tooltip, vl (2) is not. https://www.violinwiki.org/wiki/Musical_instruments_used_in_combination_with_violin Pspviwki (talk) 20:37, 23 January 2023 (UTC)

As I can see, "vl (2)" term is not present on https://www.violinwiki.org/mediawiki/index.php?title=Terminology, but "vl" is. Therefore, the tooltip does appear when you are hovering over the "vl" part of the string and does not when you are hovering over the " (2)". Elcapitan68 (talk) 02:41, 26 January 2023 (UTC)
Correct vl (2) is not the term. vl is the term, 2 in brackets is numbering. There is a space between vl and the bracket. But the defect is that the tooltip does not appear when you hover over vl that is followed by the bracket. Examples under heading Examples of standard instrumentations or line "2 fl trans solo, vl (2), vla, b, cor (2)" Pspviwki (talk) 22:37, 26 January 2023 (UTC)
The issue looks a bit oscillating, when I checked your page a week ago, I saw the tooltip as expected, I made a screenshot https://drive.google.com/file/d/1DumO8Duo8lP0W90pkH0mGXHeJ8MhKt-r/view?usp=share_link Elcapitan68 (talk) 12:25, 2 February 2023 (UTC)
Quick tests show that the problem perhaps is unrelated to "space+bracket" pattern, look at https://www.violinwiki.org/wiki/User:WikiVisor (only certain terms fail). Will take it for a closer look and update. Elcapitan68 (talk) 12:38, 2 February 2023 (UTC)
You are welcome to do as many tests you need, it might be useful for other users as well. At https://www.violinwiki.org/wiki/User:WikiVisor I see vl (2) and cor (2) as issue but tb (2) shows tooltip correctly. Pspviwki (talk) 14:12, 3 February 2023 (UTC)
It seems like it happens where it has a partial match where there is some prefix that would be a match, and there is some additional suffix that would be a match, but the actual text is in the middle, which confuses lingo.
In the particular case - "vl" matches and "vl solo" would also be a match. However, in the case of "vl (2)", lingo matches up to "vl " (vl followed by a space) but after the space, fails to match anything further. Instead of falling back to "vl" it gives up there. So that's why "vl" matches (newline and space are considered differnt) and "vl(2)" would match, but "vl (2)" does not.
Anyways, there is a patch for this issue at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Lingo/+/886439
p.s. I noticed https://www.violinwiki.org/wiki/Terminology has text "This page is not part of main but because of Lingo it has to be in Main.". Just FYI you can change the name of the terminology page by editing the page MediaWiki:lingo-terminologypagename to have whatever name you want. Bawolff (talk) 04:29, 4 February 2023 (UTC)
Sorry guys, could not give you proper test result yet, implemented Lingo 3.1.2 (836982a) from distributor for 1.38.2, the patch is for 1.39 and production environment will not go to 1.39. Pspviwki (talk) 21:21, 10 February 2023 (UTC)
Fwiw, nothing in that patch is 1.39 specific. You could probably just make the same changes to an older version of Lingo Bawolff (talk) 22:45, 10 February 2023 (UTC)
Done. a. 836982a install kept, updated src/Tree.php with 886439. Results so far so good. b. updated MediaWiki:lingo-terminologypagename to a template, good as well (I had some trouble during initial tests, no problems now). Pspviwki (talk) 15:07, 11 February 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Version clarification

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


The description page currently states "3.1.2 (2023-01-06)". But apparently version 3.1.2 is from about 2021-06-21 [1]. Current version 3.2.0 seems to be from 2023-01-26 [2]. Neither 3.1.2 nor 3.2.0 are currently officially tagged [3][4].

Could you please apply the version tags to the repository?

We're checking on this. Ike Hecht 14:57, 25 April 2023 (UTC)
Thanks!
Also, please be aware that the extensions requirement to MediaWiki core got raised from 1.31 to 1.39 in a minor level release. While MediaWiki 1.31 clearly isn't supported anymore, 1.35 is a LTS release.
I believe such changes in the requirements qualify for a major release. Osnard (talk) 06:00, 26 April 2023 (UTC)
Thanks for the heads up. The extension had been unmaintained for a while and we took over maintenance recently, which is probably why you saw the big version jump.
Note that we don't follow semver. It still might make sense to bump a major version in this case, but my sense is that a major version bump would be done only for major feature changes. Ike Hecht 16:11, 26 April 2023 (UTC)
We created the 3.2.0 tag. Please check. Ike Hecht 21:32, 26 April 2023 (UTC)
Confirmed. Thank you very much.
Regarding the major version change. Well, one can probably see it this way. And especially in the MediaWiki world it is super hard to maintain compatibility to the different versions out there (two LTS, one current stable).
In my point of view, if the code changes in a way that it breaks in environments that it likely has been running in (like MediaWiki LTS versions, PHP versions, ...) a major version bump should be done, even if the features themselves did not change. Osnard (talk) 06:21, 27 April 2023 (UTC)
So according to the SemVer spec, this should only be a minor or patch version change not a major one . My understanding of the logic behind that, is a major version change is supposed to signify that how you have to use the extension has changed in some significant way. If someone updates their version of php or MW, having the extension have only a minor version update signifies to users that they can just drop the new version in and expect no user facing changes, where a major version would indicate that they should be prepared to have to change how they use the extension.
On the other hand, lots of people do update major version number for these sorts of things, and versioning always ends up being arbitrary anyhow. Bawolff (talk) 05:54, 4 May 2023 (UTC)
You are probably right. But my case is very simple and I believe I may not be the only one this this case:
  1. I run MediaWiki 1.35, which is an LTS and officially supported until end of this year. Therefore even though I am late with updating to MediaWiki 1.39 it is still okay to run it.
  2. I am updating Extension:Lingo and expect to get new features (indicated by the minor level version bump)
  3. My wiki breaks. I either need to update my wiki as a whole or need to roll back Extension:Lingo. It is hard for me to figure out to which version I can safely update to within my environment. Osnard (talk) 14:22, 4 May 2023 (UTC)
Hmm, that's a good point.
The obvious solution is that composer should know about the mediawiki version dependency and make smart choices. The SemVer logic only works if composer is aware of all the extensions dependencies. Unfortunately support for that going forward is unclear - https://phabricator.wikimedia.org/T249573 [Edit: I don't like this solution either] Bawolff (talk) 18:13, 4 May 2023 (UTC)
Hmm, i guess we could use conflicts key. That should avoid most of the downsides Bawolff (talk) 23:03, 28 May 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Open topic with `Parser::getOutput` being `null`

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Just wanted to point out that there is an open change regarding an issue with Parser::getOutput being null.

See https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Lingo/+/745880

There is a discussion. It would be great if a maintainer could join in. Osnard (talk) 06:05, 26 April 2023 (UTC)

We'll check. Ike Hecht 15:06, 5 May 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

"LogicException: This ParserOutput contains no text!" while moving a page

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


My previous thread on Support desk: Project:Support desk/Flow/2023/05#h-"LogicException:_This_ParserOutput_contains_no_text!"_while_moving_a_page-20230502120300

While operating "Special:Movepage" on my wiki, MediaWiki reports this error output. The version of Lingo is 3.2.0. After disabling Lingo from the LocalSettings.php, the error output disappeared. So I'm pretty sure it's Lingo's bug.
[b3d9824b43681dbc22c65592] /index.php?title=Special:%E7%A7%BB%E5%8A%A8%E9%A1%B5%E9%9D%A2&action=submit   LogicException: This ParserOutput contains no text!
Backtrace:
from /www/wwwroot/sonicwiki/includes/parser/ParserOutput.php(363)
 #0 /www/wwwroot/sonicwiki/includes/parser/ParserOutput.php(412): ParserOutput->getRawText()
 #1 /www/wwwroot/sonicwiki/extensions/Lingo/src/LingoParser.php(182): ParserOutput->getText()
 #2 /www/wwwroot/sonicwiki/extensions/Lingo/src/LingoParser.php(78): Lingo\LingoParser->realParse()
 #3 /www/wwwroot/sonicwiki/extensions/Lingo/src/Lingo.php(61): Lingo\LingoParser->parse()
 #4 /www/wwwroot/sonicwiki/includes/HookContainer/HookContainer.php(338): Lingo\Lingo::Lingo\{closure}()
 #5 /www/wwwroot/sonicwiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
 #6 /www/wwwroot/sonicwiki/includes/HookContainer/HookRunner.php(1201): MediaWiki\HookContainer\HookContainer->run()
 #7 /www/wwwroot/sonicwiki/includes/content/ContentHandler.php(1736): MediaWiki\HookContainer\HookRunner->onContentAlterParserOutput()
 #8 /www/wwwroot/sonicwiki/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
 #9 /www/wwwroot/sonicwiki/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
 #10 /www/wwwroot/sonicwiki/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
 #11 /www/wwwroot/sonicwiki/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
 #12 /www/wwwroot/sonicwiki/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
 #13 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
 #14 /www/wwwroot/sonicwiki/includes/Revision/RenderedRevision.php(199): call_user_func()
 #15 /www/wwwroot/sonicwiki/extensions/TemplateData/includes/Hooks.php(99): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
 #16 /www/wwwroot/sonicwiki/includes/HookContainer/HookContainer.php(338): MediaWiki\Extension\TemplateData\Hooks::onMultiContentSave()
 #17 /www/wwwroot/sonicwiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
 #18 /www/wwwroot/sonicwiki/includes/HookContainer/HookRunner.php(2613): MediaWiki\HookContainer\HookContainer->run()
 #19 /www/wwwroot/sonicwiki/includes/Storage/PageUpdater.php(901): MediaWiki\HookContainer\HookRunner->onMultiContentSave()
 #20 /www/wwwroot/sonicwiki/includes/MovePage.php(997): MediaWiki\Storage\PageUpdater->saveRevision()
 #21 /www/wwwroot/sonicwiki/includes/MovePage.php(673): MovePage->moveToInternal()
 #22 /www/wwwroot/sonicwiki/includes/MovePage.php(520): MovePage->moveUnsafe()
 #23 /www/wwwroot/sonicwiki/includes/specials/SpecialMovepage.php(737): MovePage->moveIfAllowed()
 #24 /www/wwwroot/sonicwiki/includes/specials/SpecialMovepage.php(216): MovePageForm->doSubmit()
 #25 /www/wwwroot/sonicwiki/extensions/Translate/src/PageTranslation/MoveTranslatableBundleSpecialPage.php(155): MovePageForm->execute()
 #26 /www/wwwroot/sonicwiki/includes/specialpage/SpecialPage.php(701): MediaWiki\Extension\Translate\PageTranslation\MoveTranslatableBundleSpecialPage->execute()
 #27 /www/wwwroot/sonicwiki/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
 #28 /www/wwwroot/sonicwiki/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
 #29 /www/wwwroot/sonicwiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
 #30 /www/wwwroot/sonicwiki/includes/MediaWiki.php(562): MediaWiki->main()
 #31 /www/wwwroot/sonicwiki/index.php(50): MediaWiki->run()
 #32 /www/wwwroot/sonicwiki/index.php(46): wfIndexMain()
 #33 {main}
System Versions:
MediaWiki 1.39.3
PHP 8.1.13 (fpm-fcgi)
MySQL 8.0.24
ICU 70.1
Lua 5.1.5
Pygments 2.11.2
WrOffi (talk) 00:22, 3 May 2023 (UTC)
I wonder if it's related to PHP 8. We'll see if we can reproduce this. Ike Hecht 15:04, 5 May 2023 (UTC)
@WrOffi, I've not been able to reproduce this. Does the page you're moving have translations?
Can you share with me some steps on reproducing?
I've tried moving a regular page without translations and it works well. Looking at the backtrace, I see something related to the translate extension so I want to be sure because this could be affecting translation pages with Lingo. X-Savitar (talk) 17:30, 5 May 2023 (UTC)
Possibly related to Extension:SpamBlacklist (There was a somewhat similar issue with a different extension that only showed up when SpamBlacklist was installed). Bawolff (talk) 01:11, 6 May 2023 (UTC)
I've tried to disable SpamBlacklist and reactivate Lingo, but it shows up the error again.
After disabling Lingo, everything works fine WrOffi (talk) 12:19, 7 May 2023 (UTC)
@WrOffi, my suspicion is that this could be related to the Translate extension together with Lingo. When I have Lingo in isolation, it works fine but seems on translation pages, this causes the issue (have not yet reproduced it since I don't have the extension locally).
If you disable the Translate extension, does the "move" action work? X-Savitar (talk) 12:23, 9 May 2023 (UTC)
I think the best way to test this is to disable all other extensions and see if the issue still exists. If not, enable extensions one at a time until you find the culprit. Ike Hecht 21:03, 11 May 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Issue with Installing Lingo on MW 1.35.6

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


Hello,

I would like to install Lingo extension on Mediawiki 1.35.6; however, it seems that Lingo is not compatible anymore with the version I have. Currently I don't want to upgrade to MW 1.39. Is their any solution for that?


Mediawiki: 1.35.6

PHP: 7.4.33

MySQL: 8.0.33-0ubuntu0.20.04.1


Update:

Although it says on the repo https://github.com/wikimedia/mediawiki-extensions-Lingo that the extension requires MW 1.31 or later the extension still does not work in my case. After adding wfLoadExtension( 'Lingo' );

And then updating through php update.php /maintenance/, i get the error below: (Also the webpage turns to blank)

#0 /var/www/html/pmbd/includes/registration/ExtensionRegistry.php(258): ExtensionRegistry->re

#1 /var/www/html/pmbd/includes/Setup.php(161): ExtensionRegistry->loadFromQueue()

#2 /var/www/html/pmbd/maintenance/doMaintenance.php(91): require_once('/var/www/html/p...')

#3 /var/www/html/pmbd/maintenance/update.php(253): require_once('/var/www/html/p...')

#4 {main}


Thanks for the help :) 88.133.166.172 (talk) 07:59, 15 May 2023 (UTC)

Please, tell us what version of Lingo are you using. If you installed it from git, what is the branch you are on? Elcapitan68 (talk) 17:45, 16 May 2023 (UTC)
Thank you for your reply.
I am installing Lingo through Composer through adding the following code.
{
"require": {
"mediawiki/lingo": "^3.0",
}
}
Since I am using "^" before the version number I guess then its grabbing any or latest version of Lingo. AIDInn - pmbd (talk) 06:28, 17 May 2023 (UTC)
You are right, "^3.0" pulls the latest version, which is 1.39 compatible. For MediaWiki 1.35 please try "3.1.1":
{
"require": {
"mediawiki/lingo": "3.1.1",
}
} Elcapitan68 (talk) 16:59, 19 May 2023 (UTC)
Thank you for your reply.
I have added the line you suggested in composer.local.json. Afterwards I use composer.phar to update using the command: sudo php composer.phar update –-no-dev –-prefer-source
and now i am getting a different error proposed by the composer as shown below:
Your requirements could not be resolved to an installable set of packages.
  Problem 1
   - The requested package mediawiki/lingo (locked at 3.2.0, required as 3.1.1) is satisfiable by mediawiki/lingo[3.2.0] but these conflict with your requirements or minimum-stability.
Ill be grateful if you can help me fix this issue, Thank you in advance. AIDInn - pmbd (talk) 06:29, 22 May 2023 (UTC)
I think the correct way to overwrite the version locked in your root composer.json would be:
sudo php composer.phar update --no-dev --prefer-source mediawiki/lingo Elcapitan68 (talk) 18:22, 25 May 2023 (UTC)
I think its working now, i just installed the tgz file that is related to REL135. I will test the extension and report back if everything is working normally. Thank you for your support. I will mark this issue as resolved once i test the extension AIDInn - pmbd (talk) 08:58, 22 May 2023 (UTC)
Any success here @AIDInn - pmbd? Elcapitan68 (talk) 18:24, 25 May 2023 (UTC)
Sorry for the late reply, so far no issues. I will mark this issue as resolved. Thank you so much you for your support. AIDInn - pmbd (talk) 06:51, 30 May 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

Very strange: TOC showing at start of some pages when Lingo is enabled

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I am using the vector 2022 skin and recently installed the Lingo extension, love it but I have this very strange problem, when I have Lingo enabled, I found that the TOC is displayed at the beginning of only some pages.. if I switch to the old vector (2010) skin, the TOC displays at the beginning of all pages (which is expected). Has anyone seen this issue or any idea where could be the problem? Below are the versions:

Product Version
MediaWiki 1.39.2
PHP 8.1.13 (fpm-fcgi)
MariaDB 10.6.11-MariaDB
ICU 67.1
Lua 5.1.5
Pygments 2.11.2
Paulxu20 (talk) 17:08, 27 September 2023 (UTC)
Hi, @Paulxu20 Please, provide a link to a live page with the described TOC behavior or to a screenshot. Also, make sure your expectations about all pages are correct: by design, a table of contents is automatically generated on a page when more than three section headings are used (Manual:Table of contents) Elcapitan68 (talk) 21:58, 28 September 2023 (UTC)
Hi @Elcapitan68, thanks for the reply! Here is an example: https://papals.org/index.php?title=Test3, you can see on this page the TOC is appearing both at beginning of the page, as well as on the sidebar. And you are right, but I am under the impression that if the skin is vector 2010, the toc only appears at the beginning of the page, but if the skin is vector 2020, the toc only appears on the sidebar, no?
What is happening now is that the toc appears on both the beginning of the page and the sidebar when the skin is vector 2020, I am actually OK with this, but the problem is that it is not consistent, on some page it appears on both places, on some page it only appears on sidebar.
Pretty sure it has something to do with Lingo, because if you look at this test page https://papals.org/index.php?title=Test4, notice that it does not have the word "GU" (which is in the glossary list) on the page, and the toc only appears in sidebar. But on https://papals.org/index.php?title=Test3, it does have "GU" at beginning of the page, which triggered Lingo to render the tooltip, and the toc appears on both places. Paulxu20 (talk) 14:18, 29 September 2023 (UTC)
@Paulxu20, we should probably call it "vector-2022"? Indeed, it looks strange. The page Reading/Web/Desktop Improvements/Features/Table of contents describes the concept of the new TOC, saying that "We intentionally do not add the old table of contents to the article in addition to the new sidebar location". Please, let me know if you use caching (varnish / redis / cloudflare / file cache / etc.). Elcapitan68 (talk) 18:41, 2 October 2023 (UTC)
Hi @Elcapitan68, for caching APCu is used. In the LocalSettings.php it is set like this: $wgMainCacheType = CACHE_ACCEL;
I am not sure if this is the best caching option performance wise, but it has been working ok to me. Paulxu20 (talk) 19:42, 2 October 2023 (UTC)
@Paulxu20 I see. It looks like a side effect of the way src/LingoParser.php works. It re-renders the page injecting its elements and is not aware about the latest Vector specifics. I will create a ticket for investigating and fixing this.
In the meanwhile I suggest hiding the in-page TOC with CSS on MediaWiki:Vector-2022.css, like this:
#mw-content-text #toc {
  display: none;
} Elcapitan68 (talk) 15:39, 7 October 2023 (UTC)
I created the bug report https://phabricator.wikimedia.org/T348465 Elcapitan68 (talk) 16:06, 9 October 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.

How to use a Project namespace Terminology page?

The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.


I'm trying to use Project:Terminology as the terminology page for the extension across an entire wiki, but the extension doesn't seem to recognize that page when I set it in MediaWiki:Lingo-terminologypagename, using either "Project:Terminology" or "Wiki Name:Terminology". SlyAceZeta (talk) 04:48, 23 November 2023 (UTC)

Thank you for asking, @SlyCooperFan1
You are supposed to use a configuration variable in order to change the default page. Please try to add to your LocalSettings.php:
$wgexLingoPage = 'Project:Terminology';
The page you mention (MediaWiki:Lingo-terminologypagename) is used to create localized names for the Lingo page, eg. MediaWiki:Lingo-terminologypagename/fr, see: https://github.com/wikimedia/mediawiki-extensions-Lingo/blob/362618929b946588935d2bd15a94d9d966079481/src/BasicBackend.php#L175 Elcapitan68 (talk) 22:42, 30 November 2023 (UTC)
@SlyCooperFan1, did you have a chance to try setting $wgexLingoPage? Did it help? Elcapitan68 (talk) 16:36, 7 December 2023 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.