Extension talk:Lingo
Contents
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.
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,
when i clicked the link it sent me to the 'download mediawiki extension' not svn.. did i end up in the right spot?
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!
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,
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?
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.
I think I fixed it. Could you try the latest version from SVN?
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.
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 );
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.
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
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).
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
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,
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
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
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+.
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.
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
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);
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.
Hmm, not good. Do you have access to the server logs?
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.
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.
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
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.
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
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.
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
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,
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
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?
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?
Indeed, it doesn't work with Firefox but it works with Google Chrome.
When will Lingo support extended letters such as àéèöâ? And what about non-roman characters such as arabic, japanese, gujarati, etc... writing systems? thanks.
It should support these already. Does it not?
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.
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?
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,
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.
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 :)
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.
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.
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
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
- to exclude e.g. namespace NS_TALK from marking up you have to set
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
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.
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.
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.
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 ?
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