GHOP Issue 78 - Internationalize the Jmol

GHOP Issue 78 - Internationalize the Jmol

by Szymon Kałasz -
Number of replies: 16
Hi,
My task was:
Download Jmol filter file for Moodle (http://moodle.org/mod/data/view.php?d=13&rid=88) and change every hard-coded English texts to PHP variables, which read strings from language file, e.g.: every "viewersize" change to "get_string('viewersize')", eventually add some variables not present, to language file, e.g: $string['viewersize'] = 'Viewer size';

Please have a look at files located on http://adam.karolin.pl/issue78/ . There are two files:
  1. filter.php (/filter/jmol/filter.php)
  2. jmol.php (/lang/en_utf8/jmol.php)
I'm not sure if the jmol.php should be written by me or generated automatically by a server.
Have I done it in the right way? Please, review my work.
I worked on CVS version of Jmol filter.


Szymon
Average of ratings: -
In reply to Szymon Kałasz

Odp: GHOP Issue 78 - Internationalize the Jmol

by Szymon Kałasz -
I found two little bugs. Corrected files are uploaded.
In reply to Szymon Kałasz

Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Dan Stowell -
Hi - this looks pretty good to me. I'm one of the creators of the Jmol filter smile

I'm not involved with Moodle work at the moment but Helen pointed this GHOP project to me. I've had a read-through of your code changes and it's all looking good, well done. You said you weren't sure if you'd created the language file (jmol.php) correctly - yes, you've done it the right way.

(I should emphasise: I haven't run your code, I just read it through. Maybe a moodler could run the updated filter to give it a test-run.)

Two small comments about the contents of your language file: (1) You've written the percentages as '20%%' and '100%%', there should only be one percentage-sign each. (2) You probably don't need the backslashes which you added (most recently) to the double-quotes in the jsdisabled string, because the string is enclosed in single-quotes so double-quotes are harmless.

Other than that, definitely looks good to me smile

All the best
Dan

Average of ratings: Useful (1)
In reply to Dan Stowell

Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Szymon Kałasz -
Hi,

(1) I wrote single % for the first time and it didn't work. Using single % makes the whole string empty at the output. Of course I can change this but it just doesn't work this way. In other words, when I used single %, I got two radiobuttons with no label.
(2) I thought the same. However, I realized that without escaping " chars no string is returned at all. I mean, I'm getting "<noscript></noscript>" in the HTML instead of "<noscript>The 3D viewer...</noscript>". Then I've added backslashes and it all works now.

Maybe the actual issue is somewhere else (and I'm just doing something wrong).

Anyway, I'm happy that filter.php is good (I hope so ;) ).

Thank you for your comment smile.
Average of ratings: Useful (1)
In reply to Szymon Kałasz

Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Dan Stowell -
Thanks for the reply; I don't understand what's causing these two issues but if your tweaks fix them, then that's fine by me ;)

All the best
Dan

In reply to Szymon Kałasz

Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Geoffrey Rowland -
Picture of Plugin developers
Hi Szymon

I have been involved with some of the development of the Jmol filter, originally written by Dan. I don't get as much opportunity as I would like (Jmol is cool cool) to continue with this, so it is great that you have taken the time to work on the internationalization.

I'll take a detailed look at your code and give things a test with Moodle 1.6 & Moodle 1.9 beta together with Jmol 11.2.14 & Jmol 11.4.RC1 over the next few days. Should be able to include your code in the next release of the Jmol filter. With luck, this will be just in time for the latest stable Moodle 1.9 and Jmol 11.4 releases. I'll post again soon.

Thanks again

Geoff
Average of ratings: Useful (1)
In reply to Geoffrey Rowland

Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Szymon Kałasz -
Thanks for your feedback.

Hope the code will run smoothly with the versions of Moodle and Jmol you mentioned above.
Looking forward to hear about results of testing smile.
In reply to Szymon Kałasz

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by A FRI -
I´m a chemistry teacher and want to install the jmol filter in my moodle site (Running on 1.9 beta 4)
Unfortunately the filter thats available from the "modules and addins" page doesn´t work for me. To tell it exactly: None of the additional filters (netlogo, geogebra, freemind) seems to work in 1.9.
I don´t know whether any one else has the same problem, but I´d like to test the filter if you´d tell me where to get it.
By the way: The resource by Geoffrey Rowland works fine - thanks
In reply to A FRI

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by John Isner -
What do you mean by "doesn't work?" Please describe exactly what you did and what happened.
In reply to John Isner

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by A FRI -
I installed those filters according to the installation manuals.
Then I went to the admin page -> module -> filter and made sure they were activated (eye open große Augen).
When creating a text with editor from moodle and creating a link to a .pdb-file the link isn't seen as a jmol window, but as the original linktext.
When looking at the html of the linktext it is still written as

<a href=water.pdb>

not as

<br/> <applet>....</applet><br/>
so the filter obviously doesn't - well, filter!




In reply to A FRI

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Geoffrey Rowland -
Picture of Plugin developers

Hi

The filter should work. It's working for me on Moodle 1.6, 1.8 & 1.9 beta 4.

It may be the instruction '2. simply create a link to the molecule file...' needs some clarification.

Using Moodle's standard HTMLarea-based text editor, I usually:

  1. type a linking word e.g. 'water'
  2. click-and-drag to select this
  3. use the 'Insert Web Link' to link to the file in the course's file directory
  4. to add any additional parameters, I usually use the 'HTML Source' mode of the editor as otherwise it can get scrambled. (Indeed, my attempts to add example source code here have just got scrambled!) 

It's our half-term break next week, and so I hope to be able to spend some time updating the Jmol filter. In particular

  1. Incorporate the recent GHOP work on internationalisation (Thanks!)
  2. Better integrate the Jmol Filter and Resource
  3. Allow initial display of an image rather than the applet (as with http://jmol.sf.net). This will allow users without Java to see something *and* reduce the client load when a Moodle page has multiple applets/filters
  4. Incorporate the latest stable Jmol code as this has many enhancements in capability and performance.

Get back to us if you still have issues

In reply to Geoffrey Rowland

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Geoffrey Rowland -
Picture of Plugin developers

... and I have just updated the Jmol Filter wiki documentation.

http://docs.moodle.org/en/Jmol_filter

I hope this make things clearer... and if not, feel free to update it some more, that's what wikis are for wink.

A couple of other issues with Jmol spring to mind (i.e. have happened to me)

If you are upgrading or switching between different versions of the Jmol applet (e.g. a Jmol Resource uses version 10.x and the filter uses version 11.x the browser can get 'confused'. Clearing your browser cache should help.

If you are running short of space in your user area, e.g. with a college or work quota-based account, you may not be able to download the applet.

Hope this helps

Geoff

In reply to Geoffrey Rowland

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Antoni Salvà -
Hello Geoff,

I answer to your previous message because I think it is in the line. First of all, as a chemist, I much appreciate the Jmol filter, I've used it with no problems in 1.6 version of Moodle. We have just upgraded Moodle to 1.9 and reinstalled the Jmol resource and the Jmol filter downloaded in http://moodle.org/mod/data/view.php?d=13&rid=88 (the link in the Jmol filter wiki page is broken). The JMol resource works perfectly, but, regarding the JMol filter, the only thing I have in the screen when trying to display a .pdb file of a molecule in a resource web page loaded in the course is the Jmol window without the structure. I'm sure that the link is correct because the download button points to the .pdb file.
What puzzles me is
  1. This only happens with the Firefox browser (both Linux and Windows XP version) but the filter works correctly in MS Internet Explorer.
  2. When accessing the link in http://moodle.yeovil.ac.uk/mod/resource/view.php?id=14663 the filter works correctly, all the structures are displayed and can be rotated, zoomed, etc. in any browser that supports java. Thus, it is not a JMol filter installation issue, nor a browser one.
  3. Other java-based applications in Moodle (such as JClic) are correctly loaded and are operational. This means that it is not a Java issue.
I would much appreciate any suggestion on this.

Antoni
In reply to A FRI

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Geoffrey Rowland -
Picture of Plugin developers
Hi Andrea

Just got your email (separate post to this forum) but had some problems replying from our College email - so I'm replying by this forum too.

I have had a quick look at your installation and can confirm you have a problem with the function of the Jmol filter sad. One or two other postings have reported similar symptoms so it will be good to work out the cause(s).

As you suggested, I'll probably need FTP access, to take things further. I could then splice in working (on our Moodle 1.9 beta 4) copies of the Jmol filter and Resource types. This should help diagnose things. e.g. if I have tweaked the Jmol filter code without remembering/documenting it, or there is something else different between our Moodle environments.

If you are happy for me to do this, I suggest you send details directly to my email address.

Geoff


In reply to Geoffrey Rowland

Re: Odp: Re: Odp: Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by A FRI -
Hi Geoffrey,

with my current installation (1.9.1.) the filter "filters" instead of doing nothing at all, as it did before.

Unfortunately the jmol applet window is not opened, but the dowload and help buttons are shown.


Any ideas?

Best regards,

Andi

In reply to Dan Stowell

Re: Odp: GHOP Issue 78 - Internationalize the Jmol

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Dan, many thanks for reviewing Szymon's work. It's very kind of you to take the time to encourage further development of your Jmol filter. smile

Just wondering if there is any more of your contrib code which requires internationalizing? tongueout