"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/I18n/Translator.php" between
cakephp-4.2.2.tar.gz and cakephp-4.2.3.tar.gz

About: CakePHP is a rapid development framework for PHP applications. Source code.

Translator.php  (cakephp-4.2.2):Translator.php  (cakephp-4.2.3)
skipping to change at line 162 skipping to change at line 162
if (is_array($message)) { if (is_array($message)) {
$count = $tokensValues['_count'] ?? 0; $count = $tokensValues['_count'] ?? 0;
$form = PluralRules::calculate($this->locale, (int)$count); $form = PluralRules::calculate($this->locale, (int)$count);
$message = $message[$form] ?? (string)end($message); $message = $message[$form] ?? (string)end($message);
} }
if (strlen($message) === 0) { if (strlen($message) === 0) {
$message = $key; $message = $key;
} }
unset($tokensValues['_count'], $tokensValues['_singular']);
return $this->formatter->format($this->locale, $message, $tokensValues); return $this->formatter->format($this->locale, $message, $tokensValues);
} }
/** /**
* Resolve a message's context structure. * Resolve a message's context structure.
* *
* @param string $key The message key being handled. * @param string $key The message key being handled.
* @param array $message The message content. * @param array $message The message content.
* @param array $vars The variables containing the `_context` key. * @param array $vars The variables containing the `_context` key.
* @return string|array * @return string|array
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)