slide 15
Copyright © 2005 W3C (MIT, ERCIM, Keio)
Handling variables
Linguistic issues
printf(
"There were %d validation errors in the file %s ." ,
$errors , $filename )
printf(
"Die Datei %s enthält %d Gültigkeitsfehler." ,
$errors , $filename )
Die Datei 268 enthält 0 Gültigkeitsfehler.
Go to previous slide Go to next slide Go to the first slide Go to the slide index Go to the PDF version
Slide 15 of 81
So next we try using a printf statement. This has the benefit that text and variable locators all sit within a single string, and the translator can access the items they want to reorder.
Unfortunately, this doesn't help, since PHP still replaces the variables in the string in the order of the variables cited in the following parameters to printf. This causes the 268 to be shown instead of the filename, by converting the integer value to a string. It is unable to find an integer value in the file name, and so presents us with the zero for the number of errors.
"