yii-middleware icon indicating copy to clipboard operation
yii-middleware copied to clipboard

Flag-based implementation of Locale

Open samdark opened this issue 2 years ago • 1 comments

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues Alternative of #97

samdark avatar Jun 01 '23 08:06 samdark

PR Summary

  • Code Refactoring The code has been improved to be more readable and maintainable.

  • New Method: addLocaleCookieToResponseIfNeeded This addition checks for a cookie containing the user's language preference; if it doesn't exist, the method creates one.

  • New Method: getLocaleInfo This function returns an array containing information about the request's language settings, including its presence in the path, query parameters, or cookies, as well as information on the default language.

  • Handling Different Request Types New methods have been implemented to handle various request types based on specific criteria, such as redirecting to a URL with the correct language parameter, setting a response header with language preferences, or returning a response from a handler while properly setting up the URL generator.

what-the-diff[bot] avatar Jun 01 '23 08:06 what-the-diff[bot]