slide 23
Copyright © 2005 W3C (MIT, ERCIM, Keio)
Text string re-use
Linguistic issues
function getStatus (device) {
if ( $device .status != 0) { return 'On' ; }
else { return 'Off' ; }
<p> Printer: <?php print getStatus ($printer );?> </p>
<p> Stacker: <?php print getStatus( $stacker );?> </p>
<p> Stapler options: <?php print getStatus( $sOptions );?> </p>
Go to previous slide Go to next slide Go to the first slide Go to the slide index Go to the PDF version
Slide 23 of 81
Tempting as this idea may appear, it will unfortunately introduce insurmountable problems for translation, since the comment is likely to require different agreement forms at the least, and possibly different words altogether, depending on the context.
This slide shows an example of how such a problem may come about by returning the same text from a function for each comment.
Note that I do not want to rule out string re-use altogether - there are situations where it is a sensible approach. But re-use must not occur across different contexts. For more information about this, see the W3C Internationalization article at .