Jump to content

Extension talk:Lingo

Add topic
From mediawiki.org
Latest comment: 6 months ago by Elcapitan68 in topic SMW inline query on terminology page

Two character terms?

[edit]

It seems it is not possible to have two character terms in Lingo. Is that some technical limitation or could this be implemented? Krabina (talk) 14:52, 26 May 2025 (UTC)Reply

Hi, @Bernhard. There shouldn't be any issue using two-character terms in Lingo. In a quick test, the term "TL" appeared as expected (underlined and with a popup) [screenshot]. Could you please share some details about your environment (MediaWiki/Lingo version) and what kind of caching you're using? Elcapitan68 (talk) 13:23, 29 May 2025 (UTC)Reply
Hello am facing the same issue when using lingo(3.2.3) with Semantic glossary(5.0.1).
Am on mediawiki 1.39
Postgresql 15 Willyedoo (talk) 08:39, 18 September 2025 (UTC)Reply
I think the issue may result from this file of semantic glossary. It specify 3 letters as min length.
if ( strlen( $term ) < 3 ) {
   continue;
}
https://github.com/SemanticMediaWiki/SemanticGlossary/blob/master/src/LingoBackendAdapter.php
When Lingo is active alone, all works fine. The issue appear as soon as sematic glossary is activated. Willyedoo (talk) 14:10, 18 September 2025 (UTC)Reply
Thank you for sharing your experience, @Willyedoo. Since testing Lingo worked successfully on both your side and mine, and the issue lies with the SemanticGlossary extension, I am closing this thread. Elcapitan68 (talk) 14:32, 20 September 2025 (UTC)Reply

MW 1.44 Hot Fix

[edit]

Since "Title" was dropped in 1.44, you will run into an error when installing this extension.

Until it is updated, you will need to edit the BasicBackend.php file (located in the extensions/Lingo/src directory) to update this:

Go to line 36

use Title;

Replace with

use \MediaWiki\Title\Title;

That should fix any parsing issues.

Also, note that this is reported as https://phabricator.wikimedia.org/T398763. Joe Beaudoin Jr. Redux (talk) 22:53, 5 July 2025 (UTC)Reply

After upgrading to 1.44, and with Lingo installed, if I try to edit a page using Edit, instead of Edit source, I now get:
[36ec8aba616bf2d232a04c8e] Exception caught: Lingo\Lingo::{closure:{closure:Lingo\Lingo::initExtension():48}:76}(): Argument #2 ($title) must be of type Title, MediaWiki\Title\Title given, called in /home/wbymlrtq/michaelbeijer/w/includes/HookContainer/HookContainer.php on line 155
A workaround is to then click Dismiss, and then Edit source, and then save from there, which does work.
M.J.W.B. (talk) 23:18, 10 July 2025 (UTC)Reply
We are monitoring the bug on Phabricator. The patch (https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Lingo/+/1166508) is currently failing CI. If you don't plan to continue working on the patch, please let me know and we can consider working on it ourselves.
Elcapitan68 (talk) 21:27, 13 July 2025 (UTC)Reply
Hi there! I am definitely won't be working on the patch as I can't code, but would greatly appreciate someone else doing so since I use the extension on my website (https://michaelbeijer.co.uk/). M.J.W.B. (talk) 16:17, 15 July 2025 (UTC)Reply
Got it. We'll have a closer look. Please note that the compatibility policy of Lingo is long-term support release branches and there is no official support for non-LTS branches.
Elcapitan68 (talk) 15:48, 20 July 2025 (UTC)Reply
Hey there! Not really a coder, so any official work would be helpful. Thanks! Joe Beaudoin Jr. Redux (talk) 14:12, 8 September 2025 (UTC)Reply

SMW inline query on terminology page

[edit]

I am using a SMW ask query to produce the list of terms on the page "Terminology" (I do not have the SMW-Glossary extension, because my needs for managing terms is somewhat different and I cannot install additional extensions). However, the terminology page only recognizes the terms returned by the ask query if there is at least one regular term entry on the Terminology page itself. So my terminology page looks like this:

<div id="terminology">
{{#ask:[[Has subobject::<q>[[Term definition::+]]</q>]]
|?has subobject.Term
|?has subobject.Term definition
|?has subobject.Term synonyms
|?has subobject.Term abbreviation meaning
|valuesep=;
|format=plainlist
|headers=hide
|searchlabel= more entries
|limit=1550
|link=none
|template=Term list
}}
</div>
<div class="glossaryentry" style="color:white">
;xyarzspt:-
</div> <!--at least one term on this page is needed for the ask query results to be recognized as terms; do not delete -->

I would prefer to not have the random useless definition term on the page. Is it possible?

--MLRodrigue (talk) 11:49, 3 February 2026 (UTC)Reply

Of course, there is no need for a "white" glossary entry.
Provided one defined properties Term, Term definition and Term synonyms, and then created subobjects like this:
{{#subobject:
|Term=Term1
|Term definition=Term1 definition
|Term synonyms=Synonym, Term2, Term3 |+sep=,
}}
{{#subobject:
|Term=Term2
|Term definition=Term2 definition
|Term synonyms=Synonym, Term1, Term3 |+sep=,
}}
then the data should be accessible on an arbitrary page with the query like this:
{{#ask: [[-Has subobject::+]][[Term definition::+]]
|?Term
|?Term definition
|?Term synonyms
|mainlabel=-
|valuesep=;
|format=broadtable
|searchlabel= more entries
|limit=1550
|link=none
}}
Sorry, I omitted some parameters and used a tabular result format for simplicity.

Example of a query for SMW subobjects

Elcapitan68 (talk) 01:03, 8 February 2026 (UTC)Reply
Thanks for taking your time to look at this.
My issue was with the query running on the "Terminology" page itself. The problem I observed was that although the definition list always looked okay in the rendered html, the javascript attribute for creating the popups simply did not get generated.
I now took out the random glossary entry on the page, but the popups suddenly still work. (Cleared cache, switched browser,...). Not sure what made it suddenly work. But I spent quite some time troubleshooting this last week, and the only way the javascript worked was when I added a definition in addition to the SMW query on the page itself. Tried it many times. So strange. MLRodrigue (talk) 14:17, 9 February 2026 (UTC)Reply
It sounds like a JS initialization issue. Can you recall whether you had some error in your browser console? If you want me to investigate this deeper, please share versions of MW, SMW, Lingo and, probably, the Term list template. Elcapitan68 (talk) 17:08, 13 February 2026 (UTC)Reply