Missing locale file '/***/Zend/Locale/Data/zh_CN.xml' for 'zh_CN' locale. #296

Closed
glen-84 opened this Issue Mar 7, 2014 · 18 comments

Comments

Projects
None yet
4 participants

glen-84 commented Mar 7, 2014

After updating to ZF 1.12.4, I get this exception:

2014-03-07T17:04:45+01:00 ERR (3): Missing locale file '/***/Zend/Locale/Data/zh_CN.xml' for 'zh_CN' locale.
2014-03-07T17:04:45+01:00 ERR (3): #0 /***/Zend/Locale/Data.php(234): Zend_Locale_Data::_findRoute('zh_CN', '/ldml/numbers/c...', '', 'EUR', Array)
#1 /***/Zend/Locale/Data.php(1229): Zend_Locale_Data::_getFile('zh_CN', '/ldml/numbers/c...', '', 'EUR')
#2 /***/Zend/Currency.php(382): Zend_Locale_Data::getContent('zh_CN', 'currencytoname', 'EUR')
#3 /***/Zend/Currency.php(111): Zend_Currency->getShortName('EUR', 'zh_CN')
#4 /***/web/application/modules/tournaments/views/scripts/tournaments/view.phtml(71): Zend_Currency->__construct('EUR', Object(Zend_Locale))
#5 /***/Zend/View.php(108): include('/var/www/client...')
#6 /***/Zend/View/Abstract.php(888): Zend_View->_run('/var/www/client...')
#7 /***/Zend/Controller/Action/Helper/ViewRenderer.php(900): Zend_View_Abstract->render('tournaments/vie...')
#8 /***/Zend/Controller/Action/Helper/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('tournaments/vie...', NULL)
#9 /***/Zend/Controller/Action/Helper/ViewRenderer.php(960): Zend_Controller_Action_Helper_ViewRenderer->render()
#10 /***/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#11 /***/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#12 /***/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('viewAction')
#13 /***/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#14 /***/Zend/Application/Bootstrap/Bootstrap.php(101): Zend_Controller_Front->dispatch()
#15 /***/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#16 /***/web/public/index.php(72): Zend_Application->run()
#17 {main}

I think it's caused by #233, but I don't know what the solution is.

Member

froschdesign commented Mar 7, 2014

@glen-84
We use the CLDR - Unicode Common Locale Data Repository with the latest version (24).
The file "zh_CN.xml" was removed in version 2.0.1 of CLDR.

Member

akrabat commented Mar 7, 2014

Looks like it was replaced with zh_Hans_CN.xml, which I don't think Zend_Locale can cope with?

glen-84 commented Mar 7, 2014

@froschdesign Yes I know, but what is the correct way to avoid this exception?

glen-84 commented Mar 7, 2014

Reproduce with:

$x = new Zend_Currency('EUR', new Zend_Locale('zh_CN'));

glen-84 commented Mar 7, 2014

There are other locales that fail as well: zh_TW, sr_RS, bs_BA, zh_HK, zh_SG, ms_MY, kk_KZ

It is a nasty bug, it broke some locales in my multilingual apps. Had to roll back to 1.12.3. Waiting for solution

Member

froschdesign commented Mar 12, 2014

@glen-84

There are other locales that fail as well: zh_TW, sr_RS, bs_BA, zh_HK, zh_SG, ms_MY

Please compare with the "CLD-Repository" and you will see, these locales were removed in 2011 (CLDRv2.0.1).
The current version is 24.

Member

froschdesign commented Mar 12, 2014

@yaronius

It is a nasty bug, it broke some locales in my multilingual apps. Had to roll back to 1.12.3. Waiting for solution

This not a bug. This only a new version of the underlying library (CLDR).
Look at the file list of the "CLD-Repository".

Member

froschdesign commented Mar 12, 2014

@glen-84

Yes I know, but what is the correct way to avoid this exception?

We have to remove the outdated class constants.

glen-84 commented Mar 12, 2014

@froschdesign I know that, but this is still a BC-break because ZF can no longer handle these locales. This change should be reverted or ZF should be updated in order to handle the new CLDR data.

@froschdesign froschdesign self-assigned this Mar 12, 2014

@froschdesign froschdesign added this to the 1.12.6 milestone Mar 12, 2014

Member

froschdesign commented Mar 12, 2014

@glen-84
By the way, thank you for providing feedback.

@froschdesign I completely agree with @glen-84 that these changes made ZF 1.12.4 incompatible with previous version and Zend_Locale implementation. I just looked into ZF 1.12.3, and there are all those locales that you say were removed in 2011 - zh_TW, sr_RS, bs_BA, zh_HK, zh_SG, ms_MY. I wonder if it is a bug, but it's not an expected behaviour either.

Member

froschdesign commented Mar 12, 2014

I just looked into ZF 1.12.3, and there are all those locales that you say were removed in 2011 - zh_TW, sr_RS, bs_BA, zh_HK, zh_SG, ms_MY.

Removed from CLDR in 2011!
Until version 1.12.3, the old CLDR version was used.

New CLDR version == expected behaviour

glen-84 commented Mar 17, 2014

@froschdesign Are you planning on submitting a PR?

Member

froschdesign commented Mar 17, 2014

It's already there: #298

glen-84 commented Mar 17, 2014

Great, thanks.

Member

akrabat commented Mar 21, 2014

My main question is should we be aliasing the removed locale names to their new ones?

glen-84 commented Mar 21, 2014

Do this:

    $x = new Zend_Locale('zh_Hans_CN');
    var_dump($x);
    var_dump($x->getRegion());

    $x = new Zend_Locale('zh_CN');
    var_dump($x);
    var_dump($x->getRegion());

The region seems to be removed in both cases.

xopherdeep pushed a commit to xopherdeep/Zend-Framework-v1 that referenced this issue Jul 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment