Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Add variables capability to the t() Translate Helper

So that when in you language file you have:

'translations' => [
    'seeAllXItems' => 'See all {total} items...'
]

You can simply do:

<?= t('seeAllXItems', ['total' => 24]) ?>

This is currently possible, only not directly with the helper, but using:

<?=
I18n::template('seeAllXItems', null, [
    'total' => 24
]); 
?>
5 months ago

t() is the shorthand helper for I18n::translate() - tt() is for I18n::template(): https://getkirby.com/docs/reference/templates/helpers/tt

5 months ago
1
Changed the status to
Archived
5 months ago

Oops! 🫣

5 months ago