TRANSLATORS: convertion to XHTML for Moodle version 1.5

TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Number of replies: 25
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Important notice (in WP-style big grin )

Moodle version 1.5 will be XHTML compliant. Therefore the developers are now modifying the Moodle code, but also the language files must be converted.

It's something every Moodler can help with. If you have an hour spare time somewhere, please help. You can send your work to the translator of your languagepack who can centralise it (see http://moodle.org/download/lang)or you can send it to translation@moodle.org (use path in your zip-file). Please always download the latest language pack first.


  • All tags should be closed: <p>lalala</p>
  • All elements should be nested: <p> lalala <em>lalala</em> </p>
  • All elements and attributes must be lower case
  • All atributes should be written in full and with quotes : <p align="right"> lalala </p>
  • Empty elements must end with />: <br/> <hr/>
  • <?= and <? should be <?php
  • There should not be ANY font tags at all. <p> <em> <h1> <h2> etc should be enough for the language files ...
  • The language name in the languagepack should generally use Unicode Numeric Character References (NCR) if possible because this allows the word to work within ANY encoding context (see the Chinese pack for example).
Thank you for your help!



Average of ratings: -
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators

Hi Koen,

just for correct understanding. This changes must be done in php-files and in all the html-files?

In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
See also:
http://www.w3schools.com/xhtml/xhtml_html.asp

From the page above:

IMPORTANT Compatibility Note: To make your XHTML compatible with today's browsers, you should add an extra space before the "/" symbol like this: <br />, and this: <hr />.

In reply to Petr Skoda

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Thanks Petr, missed that one.
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators

Koen,

is the list of changes now complete?
Is there any option to check the changed files?

In reply to Ralf Hilgenstock

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Who knows gemengd gevoel
I found in the documentation from XHTML also that an < i m g   should have an alt (it can be empty) like < i m g   a l t   s r c ="picture.gif" > (forget the spaces of course)

There was also something about replacing < b > with < s t r o n g >, but I haven't found that documented and I've stopped doing that. I hope the validator shines some light on that.

I'm almost done with the conversion, only the workshop, but I have to doublecheck the translation on that one and I've had to little time lately. When I'm done, I wil use the converted languagepack on my productionsite and then I can do some validationchecks. Martin created a special theme (standardxhtml) to do that, with links to validators in the footer.
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by David Scotson -

img tags require alt attributes to be valid XHTML. To be accessible, which is the eventual goal of the move to XHTML, the alt tag should most often have text in it.

It would make sense to add this alt text at the same time if the change is being done by hand. If the replacement it is being automated then I would suggest using alt="changeme" so that alt attributes that have intentionally been left empty don't get confused with those that have only been added to achieve XHTML compliance.

This short article explains the basics of alt text: http://www.gawds.org/show.php?contentid=28

In reply to David Scotson

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Then it might be a good idea to discuss/decide what to put in the alt attribute. It is mostly used in the mods.html files for the icon (I don't know if it makes sence to provide an alt text for that, since the name of the module is in the title), in some document files (wher it is usefull to provide an alt) and in the emoticons.html, where it also doesn't make much sence to provide an alt because the description is also after the icon. Am I right or do I mis something?
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by David Scotson -

Yes, it is sometimes correct to have an empty alt text, especially if the image is decorative or the relevant alt text is already present.

I'm not sure that applies in the case of the emoticons though, as the images are also clickable links that perform an action (adding the emoticon to the text) so without an alt text you have a link with no link text.

Perhaps alt="add to post" would be better?

The other tricky aspect of this particular case is that many text-browsers do not have javascript support, maybe alt="add to post with javascript"?

I think either of those, or the blank alt attribute will be better than the filename which is what is currently added automatically in lynx

http://www.delorie.com/web/lynxview.cgi?url=http%3A%2F%2Fmoodle.org%2Fhelp.php%3Fmodule%3Dmoodle%26file%3Demoticons.html

Also, I do not have access to any screen-reader software (such as JAWS for windows) to test what it would do in this situation. Does anyone else?

(I also found this interesting link, which is semi-related: the anti-javascript FAQ)

In reply to David Scotson

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
But isn't that particular file only used with the HTML-editor, wich is optionaly and probably won't be compatible with a screenreader at all because of the Javascript?
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by David Scotson -
You can add emoticons in the text formats too wink
In reply to David Scotson

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators

David: You can add emoticons in the text formats too wink

... but then the javascript doesn't work (from the helpfile) and the images aren't necessarry, since there is the description and the characters to type to obtain the emoticon.
You're very right about the filename displayed: it's ugly and useless, so an alt-text is appropriate here. I go for the "add to post".

something like this is the result:
http://www.delorie.com/web/lynxview.cgi?url=http%3A%2F%2Fwww.ritacollege.be%2Felo%2Fhelp.php%3Ffile%3Demoticons.html
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
David meant that the Javascript to insert smilies works even when the HTML editor is switched off in a normal browser (though not under Lynx of course).

I wonder how much Javascript is supported on browsers for the blind?
In reply to David Scotson

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Hal screen reader is available as a demo - it's terrible using such software. A synthesised computervoice, making R2D2 sound like a poet,  speaks constantely. dood
In reply to David Scotson

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I've checked all the files with <img in it and it doesn't seem necessary to include an alt, except for the teachermanual, where a picture is shown and the context doesn't make it very clear what's on it.


In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Dutch is done coolslaperig
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Congrats!

Can you share with us your method to do it, e.g. some greps you've used or anything else?

Thanks in advance!
A poor translator overwhelmed by the work wink
In reply to Nicolas Martignoni

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Yes, it's quite a job, maintaining a translation.
I used Ultraedit to replace in files, eg <P to <p, /P> to /p> ... , and that with one module at the time. There aren't that many different tags used in the helpfiles.  After this 'bulk' conversion I've checked each file manualy to look for missing closing tags, other tags with problems, like the <br  and the missing /li>. There's a program called "tidy" to do this automaticaly, but by doing it manualy, I also found some typo's and stuff, so I tought it was worth the effort.

You still have time Nicolas, version 1.5 is not for the end of the month I suppose smile
In reply to Nicolas Martignoni

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I found a version of tidy, able to run in Firefox as an extention. It shows the problems in your page when you ask to view the source. There's a version running on 1.0 on the downloadpage of the developper.
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Ralf Hilgenstock -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Translators
Hi,
I found an extension with tidy for HTML-Kit. It checks the files (F9) and shows the results in two windows. You can cut and paste the right window in the left window and safe the file.
There are several preferences to choose. You find the free HTML-Kit at http://www.chami.com/html-kit/
Attachment iviewcapture_date_22_11_2004_time_22_34_03.jpg
In reply to Ralf Hilgenstock

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
No lack of tools anymore so... big grin
In reply to Ralf Hilgenstock

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Windows only angry

What a pity!
Nicolas
In reply to Nicolas Martignoni

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by Jurgis Pralgauskis -
well,
I think it would be time saving to make some scripts, whitch could correct main misvalidations:
<b> -> <em> or <strong> (NVU uses <span style="font-weight: bold;"> ),
<br> --> <br />,
tags to smallcaps
also utf-stuff
..

it would probably be ~10-50 regexps or so.

I found that gustav_delius few weeks ago and koenr (koenr) last week made lot of changes in my native-language files towards xhtml, so they probably already have sth, to automate things.

still, now, not all editors produce xhtml code, so scripts would help a lot in the long run ;)
In reply to Jurgis Pralgauskis

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Actualy I do a "replace in files" with ultraedit and then go manually trough all the files to do the final check.
This is a lot of work, but has the advantage that somethimes you spot things a computer didn't.
In reply to koen roggemans

Re: TRANSLATORS: convertion to XHTML for Moodle version 1.5

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
A lot of work is done lately in this area (I worked in alphabetical order and finished sr_utf8 ). Unfortunately the manual email notifivation and the notification by CVS mailing list missed some translators. This resulting in overwriting new, XHTML compliant files with older stuff. That way this boring job will never end.

Please use CVS for creating a local moodle copy you use for translation and always update your local copy before you begin and commit everything immediatly when you stop, even if you translated only 5 sentences.