Extension talk:Lingo

From MediaWiki.org
Jump to: navigation, search
Start a new discussion

Following space vanishes

I just found a strange quirk and its appearance is so limited that you may not want to bother trying to fix it but i figured i'd let you know.

In IE 7 the space following the use of a defined term vanishes. I've tried placing multiple spaces to no avail. I can alter the code to force a space but then the ones that were showing properly have a double space after which is almost worse. I can't get it to repeat with any other browser or any other IE version. I only noticed it because my work laptop has 7 installed and I don't have admin rights on it to upgrade. When i use my personal laptop i don't see the problem and people i know using firefox haven't seen it either.

Kay10:44, 16 November 2011

Hi Kay,

this should be fixed in the version available from SVN. Sorry, I did not have time yet to package and properly release it. You can get the SVN version from here: http://www.mediawiki.org/wiki/Special:ExtensionDistributor?extdist_extension=Lingo

Cheers,

F.trott11:05, 16 November 2011

when i clicked the link it sent me to the 'download mediawiki extension' not svn.. did i end up in the right spot?

Kay13:36, 18 November 2011

Yes, that's exactly the right spot. It will take the SVN version, zip it up and provide it for download. One more thing, though: You need to select the development version (trunk). The other one is already deprecated.

F.trott14:03, 18 November 2011
 
 
 

Partial words highlighted

Hello!

I've just finished uploading my Wiki installation to a real server (up to now it was self hosted on my computer) and I noticed something strange: entries from the Terminology page are highlighted even if they are not a whole word but a part of another. For instance:

- entry CAR, but the word CARdiology gets a partial highlight of the "car" part.

Any idea what might be causing that?

Thanks a lot!

Zkvvoob15:43, 11 October 2011

Just tried to reproduce it, but could not.

What version of PHP, MW and of Lingo are you using?

Is your wiki public so I could have a look?

Cheers,

F.trott15:59, 11 October 2011

Hello and thank you for taking the time to asnwer!

My Wiki, unfortunately, is closed and you would need to register in order to read the articles, so I wouldn't want to bother you this much. Besides, it's not in English...

Anyway, here's a screenshot in which you can clearly see my problem: the word from the Terminology page is "rigor", however it appears highlighted as a part of Grigoriy.

http://tinypic.com/r/14wc1sg/7

As for the versions: MediaWiki 1.17.0, PHP 5.2.17 (cgi), MySQL 5.0.92-community-log

Any ideas?

Zkvvoob14:12, 14 October 2011

And this happens with Lingo 0.2?

Edit: Never mind, I know what the problem is. The algorithm does not properly align on word bounderies for cyrillic script. I'll try to fix it.

F.trott14:49, 14 October 2011

I think I fixed it. Could you try the latest version from SVN?

F.trott19:36, 17 October 2011

It is fixed, indeed. Thank you very much!

On another matter, is there any possibility to have links between some of the entries in the Terminology page? For example, if we have a main entry of a word, another - like the plural form, to extract the explanation from the main entry? This would be very handy, because in Bulgarian the definite article is actually formed by adding a suffix to the word, rather than a separate particle as it is in English.

Zkvvoob18:45, 20 October 2011
 
 
 
 
 

Extra CDATA code being added to embedded scripts.

Some of my wiki articles use javascript to pop open new windows. This stopped working after installing Lingo. I also use SmoothGallery (already discussed below in Support of extended alphabet letters?), which also broke. I was able to resolve both by changing line 259 in the LingoParser.php file. It appears that the saveXML function will insert a CDATA wrapper around any javascript in order to ensure properly formed XML. However, I'm not sure that XML is necessary for this output, is it? I changed it to saveHTML, and it seems to work:

$text .= $doc->saveHTML( $child );
Jlemley16:40, 10 November 2011

I think it had something to do with saveHTML being fairly new and not being supported in older PHP versions, but that was some time ago. I'll look at it again.

F.trott10:50, 11 November 2011

Found it. The node parameter was only added in PHP 5.3.6. MW still supports PHP 5.2.3. I implemented a different fix instead and put it on SVN.

I could not get SmoothGallery to work properly, so testing is limited. Could you give it a try?

F.trott20:00, 16 November 2011
 
 

Spaces and Brackets upsetting the extension

Hi,

This does not deal with terms with a space in a phrase you may wish to refer to. I am doing some ITIL work and wish to refer to "Known Error" for instance.

I also do not get the underline when the term is in brackets.

Will these issue be addressed or am I doing something wrong.

Many thanks

JO

95.131.110.10411:52, 9 August 2011

Since version 0.2 you should be able to use any characters in a term (including punctuation, spaces, all UTF-8 characters, but excluding the colon (:) of course).

F.trott12:03, 9 August 2011

Thanks but it does not seem to be working.

For example this code:

='''K'''=
 ;Known Error:An Incident or Problem for which the root cause is known and for which a Temporary Work-around or a permanent  alternative has been identified.

Does not result in Known Error being underlined on any pages.

The version from the version page on my wiki is "Version 20110108"

Thanks

Jeremy

193.109.254.2010:03, 11 August 2011

Ok, your version is the very first version of the extension. There was no real version numbering done back then, hence the date in the version string. To use special characters you will have to upgrade to the last version.

Cheers,

F.trott10:24, 11 August 2011

Thanks. That solved things that issue. I now have an issue whereby trailing spaces are stripped off and underlined terms run into the following text.

Many thanks

JO

95.131.110.10907:24, 9 September 2011

I am not sure I understand the problem. Could you give more detail? E.g. what is the term, what is the text where it should be marked up. If you could even give a link where I could see this, that would be ideal.

Cheers,

F.trott20:31, 12 September 2011
 
 
 
 
 

Interaction bug with MediaWiki:Sidebar

Hello to all,

Lingo is a great extension, but it seems that there is an interaction bug between Lingo and MediaWiki:Sidebar. In fact, when, Lingo is ON, links and collapsing in the sidebar does not work anymore.

Any ideas ? Thanks

193.51.33.10912:07, 2 September 2011

In the beginning while testing Lingo we had some trouble while Extension:UsabilityInitiative (Vector controls MediaWiki:Sidebar) was installed. This extension is abandoned and no longer compatible with MediaWiki 1.16+.

MWJames07:29, 8 September 2011

The individual components of UsabilityInitiative have been moved to their own extensions (like Extension:Vector), and those components are no longer compatible with MW 1.16. However, if you are stuck on 1.16 for the moment, Extension:UsabilityInitiative is the way you have to go. The problem is that Lingo loads JQuery itself, which conflicts with UI. I worked around this by editing LingoParser.php and commenting out lines 280 and 283 so that Lingo would not load JQuery. This allowed the sidebar to collapse again, and Lingo still works.

Jlemley14:57, 9 November 2011
 
 

Can't get it to work at all

I am using mediawiki 1.16.5 php 5.3.2(apache) and mysql 5.0.41-log

I was previously using terminology and while it "worked" pages that had html tags or used the input box or forms extension would not show up. I liked how Lingo allowed for limiting to namespace.

I tried installed as is 'out of the box' before putting in the namespace limitations.. and all of my pages show up completely blank as soon as the extension is enabled. No error message..but no page either. when i disable the extension in local settings, it all comes back. I'm not sure where to start debugging because with no error message i don't know what about the extension it's not happy with. I am going to try disabling all of my other extensions and seeing if that helps but figured i'd post here while working my way thru that in case anyone had any thoughts.

Thanks

Kay13:02, 18 October 2011

Hi Kay,

sorry about the trouble. You are right, a blank screen is not easy to debug. To display errors include the following statements in your LocalSettings.php somewhere at the top:

error_reporting(E_ALL | E_STRICT);
ini_set("display_errors", 1);
F.trott14:44, 18 October 2011

ok i added the code segment you showed above.. saved off my localsettings.php.. uploaded it back to the server.. reloaded the page.. and nothing. i still don't get any error messages.. i simply get a http 500 error. as soon as i turn lingo back off and re upload localsettings.php my pages come back. I've checked a variety of the pages just to make sure it wasn't something that happened to be on one page.. perhaps use of an extension that conflicts.. and none of the pages in my wiki will show up, all http 500 errors.. if i hadn't be able to use terminology i'd be less confused.. but since the one worked and this is a reworking of that.. i didn't think the site would balk this much.

Kay16:18, 18 October 2011

Hmm, not good. Do you have access to the server logs?

F.trott20:22, 18 October 2011

i don't think so. i have to upload all of my changes to a dev server that is separate from the actual real server and then use a java script to transfer them over but i'll ask .. do you know which specific files would be useful? someone else is going to have to get them to me and i want to be able to give as explicit instructions as possible to point them to what i need or they will either get something that won't help OR decide that what i am asking is too much work and they don't want to be bothered.

Kay10:12, 19 October 2011

Difficult. This depends very much on how the server is set up. The name and location of the log file can be found in the server config file in the ErrorLog directive. On Unixes it is often named error_log and to be found in the /var/log/apache/ directory. If in doubt, if that directory exists ask for all the files in there.

Another thing that I can think of is, that for some reason you might be missing the dom module. If you want to check this first, create a php file with the following content:

<?php
phpinfo();

Upload this file to your server and access it via your browser. It should give you loads of information. One of the sections should be titled "dom" and basically say that all its services are enabled (DOM/XML, HTML Support, XPath Support,...). After doing this remember to delete the file again! Making all the information public could pose a security risk.

F.trott12:26, 19 October 2011
 
 
 
 
 

Wikify glossary entries (feature request ;-)

Hi :) In a glossary entry, it is sometimes useful to add internal and/or external links.
;007:James Bond [http://fr.wikipedia.org/wiki/007 my link]

007
James Bond my link

Do you think it is something difficult to implement (I do understand the difficulty regarding the complex computation for the size of the message, and I am sure that there are many other difficulties...) Many thanks, Philippe

Cornucopia20:30, 20 October 2011

I agree that it would be very useful. I just turned parsing on and did some profiling. The time spent in the relevant method went from 1.6ms to 717.5ms per request. It may be that in some future version I can figure out how to utilize the cache, but until then I will not turn on parsing.

F.trott20:55, 20 October 2011

Many thanks for your test that quickly give a raw answer regarding the complexity. Best regards. Philippe

Cornucopia11:38, 21 October 2011
 
 

Glossary entries in titles and sub-titles

Hi, Glossary entries in titles and sub-titles are not displayed properly (I am not talking about page names): the mouse pointer changes to the question mark but the associated definition is not displayed (Mediawiki 1.17 + Lingo 0.2... I will try the 0.2.1 version tomorrow)...

==JB007==

with in the glossary the following entry:

;JB007:James Bond

It could be a css issue but I am not yet sure. Many thanks, Philippe

Cornucopia21:11, 11 October 2011

It is indeed a CSS issue. Vector and Monobook skin (and probably others) set overflow:hidden for headlines. I do not know, why they would do this, it seems unnecessary to me.

To fix it find the CSS rules governing h1, h2, ... h6 in your skins CSS file and comment out or delete the overflow:hidden rule. For Monobook this is main.css around line 112, for Vector it is screen.css around line 728.

F.trott08:11, 12 October 2011

Perfect! Once again, Many thanks! Philippe

Cornucopia09:03, 12 October 2011
 
 

Glossary entry containing "0"

Hi,

Glossary entries containing "0" like the following one:

;JB007:James Bond

will give a strange result like "JB007007" where the string starting with "0" appears twice! Any idea? (Mediawiki 1.17 + Lingo 0.2 + Vector extension)

Many thanks for this nice extension :-)

Philippe

Cornucopia13:14, 27 September 2011

Nice spot! Will fix it tonight. This happens because for PHP "0", 0, and FALSE are all equivalent.

Edit: Done. Bug is fixed in new version 0.2.1

Thanks,

F.trott16:32, 11 October 2011

Many thanks for the bug fix and this nice support. Philippe

Cornucopia20:53, 11 October 2011
 
 

Magic word 'noglossary' not found

We are running MediaWiki 1.5.1 using PHP 5.2.6-1+lenny13 (apache2handler). After I installed the extension all pages showed an internal error with the headline "magic word 'noglossary' not found". In the backtrace 23 points were listed pointing to certain lines in files such as MagicWord.php, Parser.php and Cite.php. Extension:Terminology, however, works fine. Could someone explain the reasons, in case other people run into the same problem? Thanks,

Ob.helm07:33, 26 September 2011

I guess (and hope) you mean MW 1.15. Alas this is still to old, Lingo was written for MW 1.16 and above. I would recommend to upgrade MW, version 1.17 is the current one.

F.trott16:34, 11 October 2011
 

Converting from Glossary, but few terms marked up

Thanks so much for your work on this wonderful extension. I was using Glossary from a few years ago and was directed to this project as its successor. I successfully, I think, required the extension and changed the LingoPage:

require_once("$IP/extensions/Lingo/Lingo.php"); $wgexLingoPage = 'Glossary';

I see Lingo tool tips on the Glossary page and on one new heading that I entered.

http://www.circopedia.org/index.php/Glossary

And here on the first title:

http://www.circopedia.org/index.php/Charlie_Cairoli

But other pages have lost their existing Glossary entries and do not get marked up even when I edit them. Do I need somehow to force the pages to be reparsed? Thanks for any help or advice you might have!

Charles

24.147.53.5015:06, 7 September 2011

Hi Charles,

the most that should be necessary is purging a page. But that should happen every time you edit the page. You can also manually purge a page - see Purge.

F.trott20:09, 12 September 2011
 

Support of multiple monitors

Hello, I have 2 monitors on the same computer and Lingo doesn't support them, for instance when you fly over a long term, its meaning is displayed on two lines, while when you have one monitor it displays on one line only.
I've found in Lingo.js line 39 : var naturalWidth = tipdef.width();
If you put a value between the brackets, it gives a fixed size to the tip which "solves" the problem but it doesn't adapt itself to the lenght of the term description. Any fix?

Renrenfr56020:17, 14 August 2011

You are right , putting a number there only fixes the problem for your particular setup.I think this may be a browser issue. Have you tried a different browser?

F.trott20:50, 14 August 2011

Indeed, it doesn't work with Firefox but it works with Google Chrome.

Renrenfr56021:42, 14 August 2011

Ok, I do not think that I will do anything about it. The algorithm in Lingo's JavScript tries to guess the "natural" width of the tooltip. However, what is considered the natural width depends very much on the browser and its layout algorithm.

F.trott19:59, 20 August 2011
 
 
 

Support of extended alphabet letters?

When will Lingo support extended letters such as àéèöâ? And what about non-roman characters such as arabic, japanese, gujarati, etc... writing systems? thanks.

82.245.211.11107:02, 31 July 2011

It should support these already. Does it not?

F.trott10:25, 31 July 2011

It works in the Terminology page but it doesn't work when you type the acronym and do a mouse hovering. Here's a screenshot : [1] I'm using MW 1.16.2, I also tried on a clean installation, same problem.

82.245.211.11110:05, 14 August 2011

Edit : The problem was with the 0.1 version. Latest version works but it disables smoothgallery (not the case with 0.1)! Can it be fixed?

82.245.211.11110:13, 14 August 2011

My guess is, that Lingo interferes with some JavaScript. Try wrapping the gallery in an HTML element (e.g. a span or a div) and specifying class="noglossary". Should look something like this:

<div class="noglossary">
<sgallery>
Image1.jpg
Image2.gif
Image3.png
</sgallery>
</div>

Cheers,

F.trott11:29, 14 August 2011
Edited by author.
Last edit: 21:50, 14 August 2011

Thanks!
I embedded the gallery in an HTML element -> works, no problem
I installed Lingo -> Smoothgallery is not disabled but pages where Smoothgallery and Lingo are, the page has a shrunken sidebar and tabs (page, discussion, remove, etc...)
Workaround -> Do not use acronyms on articles containing Smoothgallery, it seems to fix that problem, it doesn't bother me but still it should be reviewed I guess...

You can also put

<div class="noglossary">acronym</div>

between the acronym to impeach Lingo intervening.

82.245.211.11119:43, 14 August 2011
 
 
 
 
 

Only works with certain Categoried content?

Hey there! Currently i'm having a slight issue in that the mouse over will only occur from content in a certain category! It's very strange and took me a while to work out this was the problem. Any ideas why? Thankyou :)

90.215.232.8622:55, 12 July 2011

It is indeed very strange and I have no idea. Your wiki is not public by any chance?

F.trott11:52, 13 July 2011
 

Use of acronym and abbr tags instead of span

Edited by another user.
Last edit: 14:48, 24 June 2011

I'm just thinking aloud here, but for both semantic and (I think more importantly) web accessibility reasons, is it possible to make use of the proper acronym and abbr tags instead of span? This would be of benefit to screen readers used by visually-impaired users, and also take care of the tooltip display without the need for JavaScript.

Then there is question of how to automatically distinguish between acronyms (e.g. RAM) and abbreviations (e.g. CPU) yet still have the Terminology page human-readable. Perhaps there could be two subpages of the Terminology page (Terminology/Acronyms and Terminology/Abbreviations). These two pages could be (i) simply transcluded into the Terminology page, or perhaps (ii) merged into a single alphabetical list if possible.

David09:50, 24 June 2011

In principle I agree, that it would be highly desirable to use abbr. However, this element only supports having exactly one plain-text definition for one term. It is not possible to have several definitions for one term or links or any other html elements inside. acronym is obsolete in html5.

Javascript is only used to position the tooltip. It is absolutely possible to use the extension without Javascript. The only drawback is, that the tooltip will be displayed off-screen if the term is to the very right or bottom of the screen.

Having more then one page of definitions and just transcluding them is difficult. Transcluding means invoking the wiki parser on the page. This however would also translate the semi-colons and colons used to code the terms and definitions into html. IIRC there is a way to produce "expanded" wiki text, but I'll have to investigate that. I'll note it as a feature request.

F.trott16:20, 25 June 2011
 

Shortcomings

I have been using the Terminology extension for about a year and have a few feature requests to address shortcomings:

  • Contextual Glossary - There is the possibility of having acronyms with dual definitions, like POST which depends on context of the article. A parser tag would solve this problem. Default functionality would work without parser tags based on the word order on the Terminology page.
  • Per-word disable - VIA parser tag, one should be able to disable the tooltip, such as when the word POST refers to HTTP POST,
  • Per-page/Per Category/Per Namespace disable - Similar to above
Joe-carbone19:25, 26 May 2011

The latest SVN version

  • shows all definitions for an acronym that has multiple definitions
  • ignores any element (e.g. div or table) with class='noglossary' (not internationalized)
  • provides a magic word __NOGLOSSARY__ (internationalized) to suppress the glossary for the respective article
  • provides a config setting $wgexLingoUseNamespaces to specify what namespaces should be used
    • to exclude e.g. namespace NS_TALK from marking up you have to set $wgexLingoUseNamespaces[NS_TALK]=false;
    • everything not explicitly set to false will be marked up
F.trott21:52, 11 June 2011
 

Localisation of "Terminology"

Hi, as I understand the name of the mentioned page cannot be changed/localised. It would be cool if it is at least possible to localise it. Cheers

[[kgh]]21:10, 7 June 2011

I agree, that this is not ideal. However, I am not sure that this should be handled using l10n. I think the better way would be to just add a variable that can be set in LocalSettings.php, e.g. $lingoGlossaryPage or something like that. This way you could set it to whatever name you like.

F.trott22:03, 7 June 2011

This issue struck my mind whilst translating the description message for this extension. That is why I thougt of a i10n solution. However, to me it sounds to be a very good and preferable solution to change this via the setting of a variable. Something like that should be there since people will instinctively try to change the name of this page.

[[kgh]]07:36, 8 June 2011

The pagename can now be customized by setting the variable $wgexLingoPage after the require_once in LocalSettings.php.

The default is a localized pagename. If you are unsure, what that name is in your language, just go to Special:Version, you'll find a link there.

F.trott21:05, 10 June 2011

That's awesome. :) I appreciate your work creating a very useful extension. Thank you and cheers

[[kgh]]21:19, 10 June 2011
 
 
 
 

Error: Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\wiki\extensions\Lingo\Lingo.php on line 89

After installation according to: http://www.mediawiki.org/wiki/Extension:Lingo I get: Error: Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\wiki\extensions\Lingo\Lingo.php on line 89

Is this a known solution, how can I solve this ?

62.58.98.25014:00, 31 May 2011

The version from SVN should fix this.

F.trott14:27, 31 May 2011
 

The code looks nice, but this extension - breaks the html source of the page, adding < html > and < /html > each time it's called (e.g. by templates) - preg_match_all don't recognize UTF-8 (e.g. cyrillic words) - preg_match_all offset are misplaced when 2-bit chars are in the text - should use mb_xxx functions

IP 88.125.44.8619:26, 26 May 2011

Both problems should be solved in the latest SVN version.

F.trott17:09, 27 May 2011
 
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox