Adventures with Ruby

http_accept_language released as a gem

View Comments

I released an old Rails plugin as gem today. Slowly but surely, all my plugins will be converted to gems.

This time it’s an old one: http_accept_language

  • Splits the http-header into languages specified by the user
  • Returns empty array if header is illformed.
  • Corrects case to xx-XX
  • Sorted by priority given, as much as possible.
  • Gives you the most important language
  • Gives compatible languages

For more information, read the README on GitHub.

Written by Iain Hecker

January 5th, 2010 at 12:27 pm

Posted in Uncategorized

  • http://hyggelig.org André Wendt

    Thanks for the inspiration: It might be a good idea to turn my own plugin, http://github.com/awendt/content-negotiation, into a gem.

    Back when I wrote it, I’m pretty sure I looked at your plugin, but I wanted the header turned into an array of symbols, not strings. And I didn’t need the region part, so I wrote my own plugin.

  • http://hyggelig.org André Wendt

    Thanks for the inspiration: It might be a good idea to turn my own plugin, http://github.com/awendt/content-negotiation, into a gem.

    Back when I wrote it, I’m pretty sure I looked at your plugin, but I wanted the header turned into an array of symbols, not strings. And I didn’t need the region part, so I wrote my own plugin.

  • Shell

    # Browsers send this HTTP header, so don’t think this is HOLY.
    Ja , good job !!

    Thx a lot about ur effort !!

  • Shell

    # Browsers send this HTTP header, so don’t think this is HOLY.
    Ja , good job !!

    Thx a lot about ur effort !!

blog comments powered by Disqus
Fork me on GitHub