Closed Ivanshamir closed 2 years ago
@Ivanshamir
Hi thank you for you contribution, i just wanted to clarify with you that all the routes are affected by the middleware by default. (see the photo here below). The middleware itself validates if the accept-locale is available in the request header and merge it in to request class. Else it will be defaulted to 'en'.
Maybe you would like to explain this more in an explicit way?
Thank you.
Hello, thank you for quick response. Actually as the locale is supported by only specific routes, so anyone is willing to use just Facade/World Helper Class
in any route he/she can use locale by the locale.set
middleware. Please correct me if I am wrong/not understanding properly. Thank you.
@Ivanshamir Hi again, you are totally right, when calling the helper actions, you might set the locale as App::setLocale($locale); in that case would you consider having a helper to do this? In the sense : World::setLocale('zh')->countries(); ??? if you like this would you modify your PR to do this and document it? thank you in advance.
Ok sure, I will update the PR and document it. Please give me some time. Thank you.
Hello @nnjeim I have updated the PR. Please check and let me if there is any issue. Thank you.
@Ivanshamir Thank you for this amazing contribution! All the best.
In here, I have added the details about middleware. The
locale.set
middleware will help the issue.