I know I can translate in Laravel using the __ helper function, eg - in my blade template:
{{ __("Hello") }}
But what happens when I want to mix in variables to that? For example, imagine in my controller I am using MySQL to return a concat string as a variable which I want to output in my blade:
Controller
SELECT CONCAT("Commences ", commencement_date) AS calculated_current_year ...
Template
{{ __($collection->calculated_current_year) }}
If I have the necessary translation setup (in this case, Portuguese: "Commences": "Início",
in the translation file, my expected result/output would be:
Início 2022-09-06
but instead I get
Commences 2022-09-06
How can I translate the partial match?