h3 icon indicating copy to clipboard operation
h3 copied to clipboard

detectLocaleFromCookie helper

Open DavidDeSloovere opened this issue 2 years ago • 3 comments

Clear and concise description of the problem

The Only default helper to resolve the locale is detectLocaleFromAcceptLanguageHeader. To get it from a cookie, one needs to write custom code.

Suggested solution

Implement a detectLocaleFromCookie helper

Alternative

Using custom function is already possible, but since there is a helper for accept-language already, more helpers make sense.

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

DavidDeSloovere avatar Nov 24 '23 19:11 DavidDeSloovere

I'd be happy to send a PR.

DavidDeSloovere avatar Nov 24 '23 19:11 DavidDeSloovere

Thank you for your feedback!

You are right, it would be more convenient for us if there was a helper. However, in order to support this, it is necessary to support not only Cookies, but also Queries, and Paths.

see more ref: https://github.com/intlify/h3#%EF%B8%8F-utilites--helpers

kazupon avatar Nov 27 '23 12:11 kazupon

Not sure if you want me to do it. If so, I will need #25 first.

DavidDeSloovere avatar Dec 12 '23 09:12 DavidDeSloovere