Closed remi closed 12 years ago
I implemented this feature because my current code to handle all these languages looks kind of messy :smile:
accept = env['rack-accept.request']
redirect_lang = accept.best_language(%w{fr fr-ca fr-CA fr-fr fr-FR en en-us en-US en-ca en-CA})
+1 for having this merged. What's the hold-up/objection?
Thanks for merging it!
No problem! Your patch is included in the 0.4.5 release that I pushed this morning. Sorry it took so long. I promise it won't be so long in the future!
This allows us to only declare first-level languages we want to match against and still get matchs from languge pairs (such as
fr-ca
oren-US
). This is better summarized using an example: