original_string: private function addMessage(array &$messages, array $item)
      {
          if (\is_array($item['translated'])) {
              $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]);
              if (isset($item['ids']['plural'])) {
                  $plurals = $item['translated'];
                  // PO are by definition indexed so sort by index.
                  ksort($plurals);
                  // Make sure every index is filled.
                  end($plurals);
                  $count = key($plurals);
                  // Fill missing spots with '-'.
                  $empties = array_fill(0, $count + 1, '-');
                  $plurals += $empties;
                  ksort($plurals);
                  $messages[stripcslashes($item['ids']['plural'])] = stripcslashes(implode('|', $plurals));
              }
          } elseif (!empty($item['ids']['singular'])) {
              $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']);
          }
      }
code: private function addMessage(array &$messages, array $item)
      {
          if (\is_array($item['translated'])) {
              $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated'][0]);
              if (isset($item['ids']['plural'])) {
                  $plurals = $item['translated'];
                  // PO are by definition indexed so sort by index.
                  ksort($plurals);
                  // Make sure every index is filled.
                  end($plurals);
                  $count = key($plurals);
                  // Fill missing spots with '-'.
                  $empties = array_fill(0, $count + 1, '-');
                  $plurals += $empties;
                  ksort($plurals);
                  $messages[stripcslashes($item['ids']['plural'])] = stripcslashes(implode('|', $plurals));
              }
          } elseif (!empty($item['ids']['singular'])) {
              $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']);
          }
      }
code_tokens: private function addMessage ( array & $ messages , array $ item ) { if ( \ is_array ( $ item [ 'translated' ] ) ) { $ messages [ stripcslashes ( $ item [ 'ids' ] [ 'singular' ] ) ] = stripcslashes ( $ item [ 'translated' ] [ 0 ] ) ; if ( isset ( $ item [ 'ids' ] [ 'plural' ] ) ) { $ plurals = $ item [ 'translated' ] ; // PO are by definition indexed so sort by index. ksort ( $ plurals ) ; // Make sure every index is filled. end ( $ plurals ) ; $ count = key ( $ plurals ) ; // Fill missing spots with '-'. $ empties = array_fill ( 0 , $ count + 1 , '-' ) ; $ plurals += $ empties ; ksort ( $ plurals ) ; $ messages [ stripcslashes ( $ item [ 'ids' ] [ 'plural' ] ) ] = stripcslashes ( implode ( '|' , $ plurals ) ) ; } } elseif ( ! empty ( $ item [ 'ids' ] [ 'singular' ] ) ) { $ messages [ stripcslashes ( $ item [ 'ids' ] [ 'singular' ] ) ] = stripcslashes ( $ item [ 'translated' ] ) ; } }
docstring: Save a translation item to the messages.
  
  A .po file could contain by error missing plural indexes. We need to
  fix these before saving them.
docstring_tokens: Save a translation item to the messages .