-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add support for languages (work towards Accept-Language
)
#392
base: main
Are you sure you want to change the base?
Conversation
Thanks so much for opening this! Matching on language ranges was something we've wanted for a long time, but never quite made it to the front of the list. I really appreciate you taking this work on, and am excited for us to have this functionality!
That's a good question! Our What do you think? - Do you reckon we could take that direction? |
I didn't realize the internal mime support is different than the Study the mime code and try to implement an equivalent parser/data structure. Start with just RFC 4647's language-range. Should be straightforward enough. Try to get that in, and then implement helpers for And with that, looking at the mime code - is it |
Yeah, it indeed exists to allow mime types to be defined as constants. Though the motivation was more for performance, and less for convenience. We used to use |
344c6ea
to
9bfe795
Compare
I've put up a new
And if this is good, then I should be able to get the whole thing done this weekend. |
Oh that looks like a bug. |
8b87ac1
to
efe6ea4
Compare
I think this is reasonable. I'm going to glue it into my package and see how well I can glue |
So I need good support for
Accept-Language
in a project I'm working on. I figured I'd give it a crack.I haven't implemented the header itself just yet. The implementation should be straightforward enough, there is plenty of prior work to draw from. Where I have some uncertainty and would love some feedback and guidance is with the languages inside the header should be represented.
Is there any current thoughts on how languages should be represented? My PR is laughably naive - how conformant should it be to following RFC 4647? Should it implemented outside this crate like
mime
?On this topic, from my searching there currently seems to be two crates that handle the RFC:
locale_config
andfluent-langneg
, neither which seem suitable as dependencies. Maybe a new one has to be created?