-
-
Save HirokazuNishi/f5586b3710e25e487a8667969a47c369 to your computer and use it in GitHub Desktop.
<?php | |
$lang = ['ja_JP','ko_KR','zh_Hans_CN','zh_Hant_TW','en_US']; | |
foreach($lang as $_lang) { | |
$bundle = new \ResourceBundle($_lang, 'ICUDATA'); | |
$icuData = iterator_to_array($bundle['calendar']['gregorian']['monthNames']['format']); | |
if(array_key_exists('abbreviated', $icuData)) | |
{ | |
echo $_lang . " is available on your env.\n"; | |
} else { | |
echo $_lang . " is not available on your env.\n"; | |
} | |
} |
CentOS7.x + php70u can work on ko_KR and zn_CH, but ja_JP can't.
Amazon Linux(2016.03.3) + php70 packages is same.
Magento 2.1.2 + CentOS7.2 + php56u
not available = ja_JP, ko_KR
Yes, I understand the issue but what should I do now to remove this error.
error: Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Element/Html/Calendar.php:86 Stack trace: #0 /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Element/Html/Calendar.php(86): iterator_to_array(NULL) #1 /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Html\Calendar->_toHtml() #2 /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml() #3 /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('head.calendar') #4 /home/rozander/public_html/epicdashcam.com/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('head.calendar') #5 /home/rozand in /home/rozander/public_html/epicdashcam.com/vendor/magento/framework/View/Element/Html/Calendar.php on line 86
Now, I cannot come into backend because of this issue. how would I solve this issue anyhow that can be a patch or something else but how would I solve this issue?
Magento2 uses libICU & php-intl for its internal localization process. However, php-intl & libICU are not perfectly work for all environment.
This simple check script is aims to detect your environment can host Magento2 website for CJK.
If your PHP is correct, you may find 'abbreviated' key in each result data.
From my research, these environment could not return expected result.