yii2: yii\i18n format() does not work on certain messages
To mention core Yii2, yii\widgets\BaseListView in line 163 contains:
$summaryContent = '<div class="summary">'
. Yii::t('yii', 'Showing <b>{begin}-{end, number}</b> of <b>{totalCount, number}</b> {totalCount, plural, one{item} other{items}}.')
. '</div>';
And in line 174:
return Yii::$app->getI18n()->format($summaryContent, [
'begin' => $begin,
'end' => $end,
'count' => $count,
'totalCount' => $totalCount,
'page' => $page,
'pageCount' => $pageCount,
], Yii::$app->language);
cannot process this string.
If I change line 163 to:
$summaryContent = '<div class="summary">'
. Yii::t('yii', 'Showing <b>{begin, number}-{end, number}</b> of <b>{totalCount, number}</b>.')
. '</div>';
then it replaces the labels.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 23 (12 by maintainers)
Commits related to this issue
- Added failing test for #2209 — committed to yiisoft/yii2 by samdark 10 years ago
- Fixes #2209: When I18N message translation is missing source language is now used for formatting — committed to yiisoft/yii2 by samdark 10 years ago
can you please post the ouput of the following PHP code: