The goal is to create a webiste with circa 50 pages. Content will be static (no editing, no changes) there will be pictures, paragraphs of text, unordered lists. And... three languages (probably more in the future). I want urls to be translated as well. Zend Framework must be used. No database can be used.
How to handle content in this situation? Store it as variables, and use $this->translate(), or somehow label it, and use lables inside templates开发者_开发技巧?
I would says go with an translation array for each language beside the "default" language of the Website. If you can (Haven't tested but I have seent that it is possible) you could use your "default" language text as key of those arrays. This way, when you send the translation file to the person who have to do the actual translation, they will have somekind of references as the context of the text they are translating.
Don't be afraid to use excessive amount of comments in your translation file, it will make the job easier to someone who have to translate the text.
ie:
// This section of text is used to diplays the time since the last status update
/*
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc odio nisi, varius eget
vulputate ut, cursus sit amet ligula. Maecenas dui leo, placerat et ultricies ac,
pulvinar sit amet metus. Mauris leo erat, vehicula sed interdum sed, condimentum ac
leo. Ut congue arcu ac arcu interdum egestas.
Last update - 4 hours ago
*/
array(
'Last update' => 'Dernière mise à jour',
'%hours% hours ago' => 'il y a %hours% heures',
'One hour ago' => 'il y a une heure'
)
// %hours% is a variable place holder to be replaced by you programatically
This way the person doing the translation doesn't even need to have access to the actual Website (would be smart to give access later for revision and correction).
精彩评论