Quantcast

how handle Locale ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how handle Locale ?

Elvin Şiriyev
hi,
my language files and Zend_Application Bootstrap resources config at blow.
With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some error.

How can i handle that? (it must select Locale as tr_TR and interface.tr_TR with that accepted languages)

thanks.

Errors
-------------------------------------
Notice:  The language 'tr' has to be added before it can be used. in /usr/share/php/Zend/Translate/Adapter.php on line 317
Notice:  No translation for the language 'tr' available. in /usr/share/php/Zend/Translate/Adapter.php on line 330

languages Folder
------------------------------------
languages/interface.en_US
languages/interface.ar_AE
languages/interface.ru_RU
languages/interface.zh_CN
languages/interface.tr_TR

application.ini
-----------------------------------
resources.translate.adapter = ini
resources.translate.data = APPLICATION_PATH "/../languages"
resources.translate.options.scan = filename

--
Elvin Şiriyev
http://elvin.siriyev.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Thomas Weidner
You said that you "must" be able to select "tr_TR" but your user don't
select it.
Your user selects "tr" but this language is not available, so a notice is
thrown.

Note that a NOTICE is not a error and you can also disable it. Look into the
manual.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Elvin Şiriyev" <[hidden email]>
To: <[hidden email]>
Sent: Friday, May 08, 2009 1:35 PM
Subject: [fw-general] how handle Locale ?


hi,
my language files and Zend_Application Bootstrap resources config at blow.
With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some error.


How can i handle that? (it must select Locale as tr_TR and interface.tr_TR
with that accepted languages)

thanks.

*Errors*
-------------------------------------
Notice:  The language 'tr' has to be added before it can be used. in
/usr/share/php/Zend/Translate/Adapter.php on line 317
Notice:  No translation for the language 'tr' available. in
/usr/share/php/Zend/Translate/Adapter.php on line 330

*languages Folder*
------------------------------------
languages/interface.en_US
languages/interface.ar_AE
languages/interface.ru_RU
languages/interface.zh_CN
languages/interface.tr_TR

*application.ini*
-----------------------------------
resources.translate.adapter = ini
resources.translate.data = APPLICATION_PATH "/../languages"
resources.translate.options.scan = filename

--
Elvin Şiriyev
http://elvin.siriyev.net

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Elvin Şiriyev
I can disable notice but zend locale can't choose nearest (tr_TR) instead of 'tr' :) is there any easy way for that?
resources.translate.locale is not what i want.

thanks

On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner <[hidden email]> wrote:
You said that you "must" be able to select "tr_TR" but your user don't select it.
Your user selects "tr" but this language is not available, so a notice is thrown.

Note that a NOTICE is not a error and you can also disable it. Look into the manual.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
To: <[hidden email]>
Sent: Friday, May 08, 2009 1:35 PM
Subject: [fw-general] how handle Locale ?



hi,
my language files and Zend_Application Bootstrap resources config at blow.
With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some error.


How can i handle that? (it must select Locale as tr_TR and interface.tr_TR
with that accepted languages)

thanks.

*Errors*
-------------------------------------
Notice:  The language 'tr' has to be added before it can be used. in
/usr/share/php/Zend/Translate/Adapter.php on line 317
Notice:  No translation for the language 'tr' available. in
/usr/share/php/Zend/Translate/Adapter.php on line 330

*languages Folder*
------------------------------------
languages/interface.en_US
languages/interface.ar_AE
languages/interface.ru_RU
languages/interface.zh_CN
languages/interface.tr_TR

*application.ini*
-----------------------------------
resources.translate.adapter = ini
resources.translate.data = APPLICATION_PATH "/../languages"
resources.translate.options.scan = filename

--
Elvin Şiriyev
http://elvin.siriyev.net




--
Elvin Şiriyev
http://elvin.siriyev.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Thomas Weidner
Again, please look into the manual.
There you can read that locales are ONLY downwards detectable.

Example:
When your user requests en_US then en can be used instead

BUT
When your user requests en and you give en_US and en_GB and en_VE, how
should the system then know which locale should be used ?

There is no way, so you can only set the wished locale manually in this
case.
All the reasons, and solutions are described in the manual.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Elvin Şiriyev" <[hidden email]>
To: "Thomas Weidner" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, May 08, 2009 3:12 PM
Subject: Re: [fw-general] how handle Locale ?


I can disable notice but zend locale can't choose nearest (tr_TR) instead of
'tr' :) is there any easy way for that?
resources.translate.locale is not what i want.

thanks

On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner <[hidden email]>wrote:

> You said that you "must" be able to select "tr_TR" but your user don't
> select it.
> Your user selects "tr" but this language is not available, so a notice is
> thrown.
>
> Note that a NOTICE is not a error and you can also disable it. Look into
> the manual.
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> ----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, May 08, 2009 1:35 PM
> Subject: [fw-general] how handle Locale ?
>
>
>
> hi,
> my language files and Zend_Application Bootstrap resources config at blow.
> With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some
> error.
>
>
> How can i handle that? (it must select Locale as tr_TR and interface.tr_TR
> with that accepted languages)
>
> thanks.
>
> *Errors*
> -------------------------------------
> Notice:  The language 'tr' has to be added before it can be used. in
> /usr/share/php/Zend/Translate/Adapter.php on line 317
> Notice:  No translation for the language 'tr' available. in
> /usr/share/php/Zend/Translate/Adapter.php on line 330
>
> *languages Folder*
> ------------------------------------
> languages/interface.en_US
> languages/interface.ar_AE
> languages/interface.ru_RU
> languages/interface.zh_CN
> languages/interface.tr_TR
>
> *application.ini*
> -----------------------------------
> resources.translate.adapter = ini
> resources.translate.data = APPLICATION_PATH "/../languages"
> resources.translate.options.scan = filename
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>
>


--
Elvin Şiriyev
http://elvin.siriyev.net

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Steve Clay
In reply to this post by Elvin Şiriyev
Elvin Şiriyev wrote:
> I can disable notice but zend locale can't choose nearest (tr_TR)
> instead of 'tr' :) is there any easy way for that?

Kind of a hack, but... You could rewrite the user's Accept-Language
request header.

--
Steve Clay
http://mrclay.org/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Elvin Şiriyev
In reply to this post by Thomas Weidner
I think i'm looking for function like that: http://tr.php.net/manual/en/locale.lookup.php
is there any thing like that?

On Fri, May 8, 2009 at 6:40 PM, Thomas Weidner <[hidden email]> wrote:
Again, please look into the manual.
There you can read that locales are ONLY downwards detectable.

Example:
When your user requests en_US then en can be used instead

BUT
When your user requests en and you give en_US and en_GB and en_VE, how should the system then know which locale should be used ?

There is no way, so you can only set the wished locale manually in this case.
All the reasons, and solutions are described in the manual.


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
To: "Thomas Weidner" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, May 08, 2009 3:12 PM
Subject: Re: [fw-general] how handle Locale ?



I can disable notice but zend locale can't choose nearest (tr_TR) instead of
'tr' :) is there any easy way for that?
resources.translate.locale is not what i want.

thanks

On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner <[hidden email]>wrote:

You said that you "must" be able to select "tr_TR" but your user don't
select it.
Your user selects "tr" but this language is not available, so a notice is
thrown.

Note that a NOTICE is not a error and you can also disable it. Look into
the manual.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
To: <[hidden email]>
Sent: Friday, May 08, 2009 1:35 PM
Subject: [fw-general] how handle Locale ?



hi,
my language files and Zend_Application Bootstrap resources config at blow.
With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some
error.


How can i handle that? (it must select Locale as tr_TR and interface.tr_TR
with that accepted languages)

thanks.

*Errors*
-------------------------------------
Notice:  The language 'tr' has to be added before it can be used. in
/usr/share/php/Zend/Translate/Adapter.php on line 317
Notice:  No translation for the language 'tr' available. in
/usr/share/php/Zend/Translate/Adapter.php on line 330

*languages Folder*
------------------------------------
languages/interface.en_US
languages/interface.ar_AE
languages/interface.ru_RU
languages/interface.zh_CN
languages/interface.tr_TR

*application.ini*
-----------------------------------
resources.translate.adapter = ini
resources.translate.data = APPLICATION_PATH "/../languages"
resources.translate.options.scan = filename

--
Elvin Şiriyev
http://elvin.siriyev.net




--
Elvin Şiriyev
http://elvin.siriyev.net




--
Elvin Şiriyev
http://elvin.siriyev.net
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how handle Locale ?

Thomas Weidner
No you don't.

Locale::Lookup works according to RFC-4647, which is exactly the algorithm
which is used by Zend_Locale.
Locales with script or private tags are downgraded... also called fallback.

so "tr_TR_Hant_common" will become "tr_TR" or "tr".

But also Locale::Lookup can not make a upgrade to get "tr_TR" from a "tr"
locale.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message -----
From: "Elvin Şiriyev" <[hidden email]>
To: "Thomas Weidner" <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, May 14, 2009 12:46 PM
Subject: Re: [fw-general] how handle Locale ?


I think i'm looking for function like that:
http://tr.php.net/manual/en/locale.lookup.php
is there any thing like that?

On Fri, May 8, 2009 at 6:40 PM, Thomas Weidner <[hidden email]>wrote:

> Again, please look into the manual.
> There you can read that locales are ONLY downwards detectable.
>
> Example:
> When your user requests en_US then en can be used instead
>
> BUT
> When your user requests en and you give en_US and en_GB and en_VE, how
> should the system then know which locale should be used ?
>
> There is no way, so you can only set the wished locale manually in this
> case.
> All the reasons, and solutions are described in the manual.
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
> ----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
> To: "Thomas Weidner" <[hidden email]>
> Cc: <[hidden email]>
> Sent: Friday, May 08, 2009 3:12 PM
> Subject: Re: [fw-general] how handle Locale ?
>
>
>
> I can disable notice but zend locale can't choose nearest (tr_TR) instead
> of
> 'tr' :) is there any easy way for that?
> resources.translate.locale is not what i want.
>
> thanks
>
> On Fri, May 8, 2009 at 4:06 PM, Thomas Weidner <[hidden email]
> >wrote:
>
>  You said that you "must" be able to select "tr_TR" but your user don't
>> select it.
>> Your user selects "tr" but this language is not available, so a notice is
>> thrown.
>>
>> Note that a NOTICE is not a error and you can also disable it. Look into
>> the manual.
>>
>> Greetings
>> Thomas Weidner, I18N Team Leader, Zend Framework
>> http://www.thomasweidner.com
>>
>> ----- Original Message ----- From: "Elvin Şiriyev" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Friday, May 08, 2009 1:35 PM
>> Subject: [fw-general] how handle Locale ?
>>
>>
>>
>> hi,
>> my language files and Zend_Application Bootstrap resources config at
>> blow.
>> With "tr,az;q=0.8,en-us;q=0.5,en;q=0.3" accepted languages I get some
>> error.
>>
>>
>> How can i handle that? (it must select Locale as tr_TR and
>> interface.tr_TR
>> with that accepted languages)
>>
>> thanks.
>>
>> *Errors*
>> -------------------------------------
>> Notice:  The language 'tr' has to be added before it can be used. in
>> /usr/share/php/Zend/Translate/Adapter.php on line 317
>> Notice:  No translation for the language 'tr' available. in
>> /usr/share/php/Zend/Translate/Adapter.php on line 330
>>
>> *languages Folder*
>> ------------------------------------
>> languages/interface.en_US
>> languages/interface.ar_AE
>> languages/interface.ru_RU
>> languages/interface.zh_CN
>> languages/interface.tr_TR
>>
>> *application.ini*
>> -----------------------------------
>> resources.translate.adapter = ini
>> resources.translate.data = APPLICATION_PATH "/../languages"
>> resources.translate.options.scan = filename
>>
>> --
>> Elvin Şiriyev
>> http://elvin.siriyev.net
>>
>>
>>
>
> --
> Elvin Şiriyev
> http://elvin.siriyev.net
>
>


--
Elvin Şiriyev
http://elvin.siriyev.net

Loading...