diff --git a/library/Zend/Locale/Data.php b/library/Zend/Locale/Data.php index 8ba2a21f9e..395f5d5013 100644 --- a/library/Zend/Locale/Data.php +++ b/library/Zend/Locale/Data.php @@ -241,6 +241,14 @@ private static function _getFile($locale, $path, $attribute = false, $value = fa // 3. -> zh // 4. -> root if (($locale != 'root') && ($result)) { + // Search for parent locale + if (false !== strpos($locale, '_')) { + $parentLocale = self::getContent($locale, 'parentlocale'); + if ($parentLocale) { + $temp = self::_getFile($parentLocale, $path, $attribute, $value, $temp); + } + } + $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); if (!empty($locale)) { $temp = self::_getFile($locale, $path, $attribute, $value, $temp); diff --git a/tests/Zend/Locale/DataTest.php b/tests/Zend/Locale/DataTest.php index f00497d929..0272030147 100644 --- a/tests/Zend/Locale/DataTest.php +++ b/tests/Zend/Locale/DataTest.php @@ -7277,4 +7277,13 @@ public function testGetParentLocale() $result = Zend_Locale_Data::getContent('de_DE', 'parentlocale'); $this->assertFalse($result); } + + /** + * @group GH-516 + */ + public function testLocaleWhichHasParentLocale() + { + $result = Zend_Locale_Data::getContent('en_HK', 'nametocurrency', 'XAF'); + $this->assertEquals('Central African CFA Franc', $result); + } }