Zend Framework

use of Zend_Locale in Zend_Translate

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not an Issue
  • Affects Version/s: 1.8.1
  • Fix Version/s: 1.8.2
  • Component/s: Zend_Translate
  • Labels:
    None

Description

Zend_Translate()>setLocale('en_US')>translate('something')

is not equal with

Zend_Translate()>setLocale('en')>translate('something')

if, let's say, I want to define ONLY 'en' or 'en_US', which, in my opinion, is the same.

To have Zend_Translate understand both locales, I have to duplicate the translations for both locales. This is not an option in case of large translations files on large projects.

Suggestion: use only the language part of the locale or, even better, if the locale have an exact match in the translation arrays use it, else use only the language part of locale.

Activity

Hide
Thomas Weidner added a comment -

Of course they are not equal.

You have to keep in mind that languages differ per region.
Brittish english is not american english.

And many bigger sites support both.

So simple as is:
When you support only one english dialect use "en".
But when you also support other dialects then use full locales.

Note:
According to the manual the locale "en_US" is automatically degraded to "en" when "en_US" is not available.
This is no fault, this is expected I18N behaviour and not ZF specific.

Show
Thomas Weidner added a comment - Of course they are not equal. You have to keep in mind that languages differ per region. Brittish english is not american english. And many bigger sites support both. So simple as is: When you support only one english dialect use "en". But when you also support other dialects then use full locales. Note: According to the manual the locale "en_US" is automatically degraded to "en" when "en_US" is not available. This is no fault, this is expected I18N behaviour and not ZF specific.
Hide
Thomas Weidner added a comment -

Closing as non-issue.
Please read the manual for details about how I18N works with translation and degrading.

Show
Thomas Weidner added a comment - Closing as non-issue. Please read the manual for details about how I18N works with translation and degrading.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: