Issues

ZF-3617: Standardized locale string is not recognized

Description

class Zend_Locale does not recognize standardized locale strings. According to the RFC: http://tools.ietf.org/html/rfc4646 see section "2.1. Syntax" " ... Subtags are distinguished and separated from one another by a hyphen ("-", ABNF [RFC4234] %x2D)." a hyphen is the one and only characted to separate language and country parts of the locale.

Reproduce error with:


  $locale1 = new Zend_Locale('en-US');
  var_dump($locale1->toString())."\n";
  var_dump(Zend_Locale::isLocale('en-US'))."\n";
  exit;

result: string(2) "en" bool(false)

expected: en-US en-US

Comments

Please read the documentation about how a locale string has to look like to be recognised.

This RFC is not supported for now. So this is not a bug but a feature request.

Added support for RFC4646 with r11114

Updating for the 1.6.0 release.