title: Cakephp i18n translation formatter U_ILLEGAL_ARGUMENT_ERROR
body: <p>In Cakephp 2, I was using this <a href="https://github.com/cakephp/localized" rel="nofollow">repo</a> for cake.po translations. But it seems like it isn't not updated for Cakephp 3. So I runned i18n shell as noted <a href="http://book.cakephp.org/3.0/en/console-and-shells/i18n-shell.html#generating-pot-files" rel="nofollow">here</a> and created <code>cake.pot</code> file. Then I made some of translations and added <code>cake.po</code> files into the folder <code>src\Locale\</code>. </p>
  
  <p>When the msgstr part is empty, <code>timeAgoInWords</code> shows English words, if translation found, cakephp shows translated version. </p>
  
  <p>But this doesn't work for Arabic language. Other languages works well.</p>
  
  <p>In cakephp 3 while making a <code>timeAgoInWords</code> like this:</p>
  
  <pre><code>$string = $this-&gt;Time-&gt;timeAgoInWords(1338659672, array('end' =&gt; '+10 year'));
  </code></pre>
  
  <p>I get this error: <code>Error: [Aura\Intl\Exception\CannotInstantiateFormatter] msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR</code></p>
  
  <p>Error stack:</p>
  
  <pre><code>Error: [Aura\Intl\Exception\CannotInstantiateFormatter] msgfmt_create: message formatter creation failed: U_ILLEGAL_ARGUMENT_ERROR
  Request URL: /ar/tools/
  Stack Trace:
  #0 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php(71): Cake\I18n\Formatter\IcuFormatter-&gt;_formatMessage('ar', NULL, Array)
  #1 /var/www/vhosts/example.com/httpdocs/app/vendor/aura/intl/src/Aura/Intl/Translator.php(142): Cake\I18n\Formatter\IcuFormatter-&gt;format('ar', Array, Array)
  #2 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/I18n/functions.php(110): Aura\Intl\Translator-&gt;translate('{0} years', Array)
  #3 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/I18n/Time.php(384): __dn('cake', '{0} year', '{0} years', 3, 3)
  #4 /var/www/vhosts/example.com/httpdocs/app/src/Template/Tools/index.ctp(62): Cake\I18n\Time-&gt;timeAgoInWords(Array)
  #5 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/View/View.php(833): include('/var/www/vhosts...')
  #6 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/View/View.php(793): Cake\View\View-&gt;_evaluate('/var/www/vhosts...', Array)
  #7 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/View/View.php(464): Cake\View\View-&gt;_render('/var/www/vhosts...')
  #8 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/Controller/Controller.php(582): Cake\View\View-&gt;render(NULL, NULL)
  #9 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(120): Cake\Controller\Controller-&gt;render()
  #10 /var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/Routing/Dispatcher.php(87): Cake\Routing\Dispatcher-&gt;_invoke(Object(App\Controller\ToolsController))
  #11 /var/www/vhosts/example.com/httpdocs/app/webroot/index.php(37): Cake\Routing\Dispatcher-&gt;dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
  #12 {main}
  
  Notice: Notice (8): Undefined offset: 3 in [/var/www/vhosts/example.com/httpdocs/app/vendor/cakephp/cakephp/src/I18n/Formatter/IcuFormatter.php, line 68]
  Trace:
  Cake\Error\BaseErrorHandler::handleError() - CORE/src/Error/BaseErrorHandler.php, line 138
  Cake\I18n\Formatter\IcuFormatter::format() - CORE/src/I18n/Formatter/IcuFormatter.php, line 68
  Aura\Intl\Translator::translate() - ROOT/vendor/aura/intl/src/Aura/Intl/Translator.php, line 142
  __dn - CORE/src/I18n/functions.php, line 110
  Cake\I18n\Time::timeAgoInWords() - CORE/src/I18n/Time.php, line 384
  include - APP/Template/Tools/index.ctp, line 62
  Cake\View\View::_evaluate() - CORE/src/View/View.php, line 833
  Cake\View\View::_render() - CORE/src/View/View.php, line 793
  Cake\View\View::render() - CORE/src/View/View.php, line 464
  Cake\Controller\Controller::render() - CORE/src/Controller/Controller.php, line 582
  Cake\Routing\Dispatcher::_invoke() - CORE/src/Routing/Dispatcher.php, line 120
  Cake\Routing\Dispatcher::dispatch() - CORE/src/Routing/Dispatcher.php, line 87
  [main] - ROOT/webroot/index.php, line 37
  </code></pre>
  
  <p>Edit: I get very similar error for Russian language. When I remove <code>src\Locale\ru\cake.po</code> file, I get <code>U_ILLEGAL_ARGUMENT_ERROR</code> again. Note that Russian has 3 plural form, while English and other languages have 2 plural forms.</p>