How does one validate the php and docs for xhtml compliance?

How does one validate the php and docs for xhtml compliance?

by Roel Cantada -
Number of replies: 3
Hi Moodle translators,

Can anyone please give me some tips on how to validate the php and help files for xhtml compliance.

My problem is when i give the validator the url of the lang files, i get errors because they don't have headers or meta information.  E.g. i give it \http://mymoodle/lang/tl/moodle.php.

Do we have to give it the url of the parsed html.  If so how do we easily identify the erroneous line, i.e. the edit lang page puts the strings inside value for instance.

I'am using w3c and wdg offline markup validators.

Average of ratings: -
In reply to Roel Cantada

Re: How does one validate the php and docs for xhtml compliance?

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
Yes, you need to pass it the URL as a person would see it.

Here is an example: http://moodle.org/help.php?module=moodle&file=search.html&lang=tl

The string files (eg moodle.php) should have barely any XHTML in them at all and even then it's really simple, so you can check them manually.
In reply to Martin Dougiamas

Re: How does one validate the php and docs for xhtml compliance?

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
It is indeed very easy to do it by hand. You just have to folow the rules mentioned in the translation manual (http://moodle.org/doc/?frame=translation.html)
The English files are all ok, also all translated php files (at least they have been ok wink ), so they can be used as an example.

Once your language file is ok (and I think it is), you can use firefox browser with a Tidy plug-in. You shouldn't see any errors/warnings when surfing your 1.5 moodle. If you do find errors or warning, you can see what the problem is. When it is in your language-pack, you can fix it, when it isn't in your language pack, try to put it in the bugtracker (whit sollution is preferred smile )
In reply to koen roggemans

Re: How does one validate the php and docs for xhtml compliance?

by Roel Cantada -
Thanks guys for the tips, unfortunately the tidy extension for linux does'nt work on my debian sarge firefox. I keep getting illegal instruction error and firefox would not restart. So i found a different approach which may save translators using Debian GNU/Linux some cutting & pasting of urls.

The solution i would like to share, tries to solve the problem of using the local w3c-markup-validator and wdg-html-validator without having to cut and paste urls. Both validators are available as deb packages for sarge.

So i simply changed mozilla-checky, a debian package of a firefox extension which uses online validators. I made it point to the local validators mentioned and it worked. All one has to do now is go to Tools>>Checky>>choose the validator.

Unfortunately i'm not a programmer, so if you install this deb package you won't be able to use the public online validator of w3c and wdg. The proper solution should have been to merely add the local validators, but this is beyond my capability. Apologies to the package maintainer as well since i don't know how to change the info on the package to reflect the changes i made. I also changed the w3c checklink as well but the html url is not passed to checklink. The html validators did not have this problem.

If you want to do this hack yourself rather than install my attached package, here is the detail of what i did:

1. downloaded sourcefiles (tar.gz, .dsc, .diff) for mozilla-checky from debian.org. Testing or sarge version.

2. #dpkg-source -x mozilla-checky.dsc

3. #cd checky-2.5/checky/content/checky/

4. edited common.js, and replaced the w3c and wdg validator urls with localhost validators.

5. #dpkg-buildpackage

6. #dpkg -i checky....deb //to install the package.

I hope this would be useful to other translators using debian GNU/Linux systems.