Hi.

I want to translate site http://automobi.li/ to other languages, and I'm
thinking about best practices on how to do it for best seo, user expirience
and architecture.

First of all, in order to have google indexing it on different languages, I
will create subdomains http://en.automobi.li/,
http://ru.automobi.li/<http://en.automobi.li/> ...
for each language.

And there, the first problem occured :

*Sharing same session accrosss subdomains*.

I tried adding Zend_Session::start(array('cookie_domain' => '.domain.com'));
in my bootstrap, but it didnt help. Then I tried php_value
session.cookie_domain ".domain.com" (
http://www.jontodd.com/2006/08/10/php-session-cookie-multiple-domains/) but
still no results. That is the first question.

Now, when I setup sharing same session, I need to get language from domain
name, anything in zend framework to help here (if not it can be easily
parsed in native PHP).

I already have Zend_From set translated error messages

$translate = new Zend_Translate( Zend_Translate::AN_ARRAY,
realpath(APPLICATION_PATH . '/../data/languages/sr/Zend_Validate.php'),
Zend_Registry::get('Zend_Locale') );
Zend_Form::setDefaultTranslator($translate);

I'm planing to add one more translation file (array) for labels, is there a
way to add separate file to Zend_Translate? And one more po file for view
scripts. Or one po file for form labels and view scripts if poedit can be
set to extract translation from my forms, which are written with factory
methods, like:

$this->addElement(
'uiText',
'name',
 array(
'label' => 'Ime:',
'id' => 'contact_name',
 'filters' => array('StringTrim'),
'required' => true,
 'validators' => array(array('Alpha', false, true))
)

I don't think poedit can parse this. Or?
So, question is: I have validation messages (Array), labels and view
scripts, I want to translate and automate parsing new translation strings as
much as possible, poedit looks like the best way to go. But must keep
validation messages (and labels) separated in some way.

So, there is a language, and one more global parameter will be a country
where user is located. This can be some global param stored in session, and
maybe switch it to new value when changing language, but still allow changin
country separate from language and having default country for each language
(subdomain). What do you think?

What are your patterns and best practices, tools...when internationalizing
zf powered website?

Regards,
Saša Stamenković

Reply via email to