views:

35

answers:

1

Hi,

How should be form element names, table column manes, free text etc.. translated in multilanguage website on Zend Farmework. The body of websites already translated and stored in database but the rest not.

Example for parts that not translated:Name, Phone:

<form>
<label>Name: </label>
<input type="text">
<label>Phone: </label>
<input type="text">
</form>
+1  A: 

You can use whatever you feel is appropriate for the translation labels.

Some people prefer numbers, some prefer tags, some just put in the regular text, e.g.

echo $this->translate('123');
echo $this->translate('contactform.label.phone');
echo $this->translate('Phone');

It's much more important that you keep it consistent, once you decided what to use.

See the chapter on Using Translation Adapters in the ZF Reference Guide

Gordon
Hi Gordon, where should i put translation of labels(can you write example please)? what do you think about google translator toolkit to that parpose?Thanks
Yosef
@Yosef There is plenty of examples in the linked ZF reference guide. Put the translations into the source file applicable to the translation adapter you use. Which one you use is up to you. If it is not too many translations, you might find the array adapter the easiest and quickest to work with. I've never worked with the Google thing. PHP also has [gettext](http://de3.php.net/manual/en/gettext.requirements.php) if you don't like `Zend_Translate`.
Gordon