I’ve been pondering the best way of writing a piece of code that will,
when given a list of language options, select the one that best
what is being requested in an Accept-Language header.
If one has a list of en, en-gb and es, and one gets an Accept-Language
header like this:
the code would return the ‘es’ as the best matching language option.
Is there some already written Ruby code hiding in a project somewhere to
do this? Is there some piece of C library somewhere that I could just
write an extension for to do it? Can someone offer up a fast Ruby
implementation to handle Accept-Language decisions?
I’ve hacked out an almost right approach, but I’m not happy with it.