-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Description
Hello
First of all, thank you for this amazing framework π
When using translation strings with params in large applications, we keep injecting the same params:
- a user's name, first, or last name
- a brand name
- an application name
- a customer's name
- ...
And it's pretty difficult to enforce a strict naming convention.
For instance, we can have these variations about a user's name:
user_nameusernameuserNamename
It would be nice to have a way to define a set of common params that don't need to be injected every time the trans() method is invoked within PHP code or a Twig template.
Thanks!
Example
setDefaultParams([ 'first_name' => 'Sylvain', 'company' => 'AssoConnect', ]); // hello: 'Hello {first_name}, you work at {company} $translor->trans('hello'); // Hello Sylvain, you work at AssoConnectcindyEmile1, 94noni, hammat and codegain