New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the order of the trans
method arguments
#12663
Conversation
currently if we want to get the localized string in a particular language we need to do it like this: trans(‘messages.welcome’, [], 'messages', $theTargetLocale); after this changes we’ll do it like this: trans(‘messages.welcome’, $theTargetLocale);
So this would be breaking? |
@lagbox this helper method is used (elsewhere in the framework) with just the first argument ( |
If my current code has this trans('messages.welcome', [], 'messages', $theTargetLocale); This will break right? |
@lagbox yes, but it is unlikely that you'll use it this way, since (in the majority of cases) you'll need to set up your locale in the this commit make it possible to deal with more then one language at the same time, i.e use |
It doesn't matter how likely something is or not. This function exists with arguments in a particular order, if anyone in the entire world is passing more than 1 argument to that function this will break their code? So its a breaking change. |
👎
By the way, the |
@vlakoff we need to keep
BTW, |
Thanks for pointing to the Symfony interface. Maybe Not to mention BC break, and consistency with Why wouldn't you simply do |
please check my previous comment |
@GrahamCampbell For future reference, something like this should be targeting the next version since it is breaking? I know I always like to hear how people would like to use these helper functions. @djug I only found this function being used in the Foundation\Auth\ResetsPasswords trait, which even though is located in the core, is used by something Application level (PasswordController) . If that is the case you can define this function as you would like, and intend to use it, in your own application, before this helpers file is loaded. |
@djug Also, you changed the param order but left the docblock untouched… |
Currently if we want to get the localized string in a particular language we need to do it like this:
trans(‘messages.welcome’, [], 'messages', $theTargetLocale);
after this changes we’ll do it like this:
trans(‘messages.welcome’, $theTargetLocale);