lib/rack/geo_locale.rb in rack-geo-locale-0.0.6 vs lib/rack/geo_locale.rb in rack-geo-locale-0.0.7
- old
+ new
@@ -10,14 +10,20 @@
@app = app
end
def call(env)
- env["locale.language"], env["locale.country"] = parse_locale(env)
+ language, country = parse_locale(env)
- if country = parse_country(env)
- env["locale.country"] = country
+ if c = parse_country(env)
+ country = c
end
+
+ language.downcase! if language
+ country.upcase! if country
+
+ env["locale.language"] = language
+ env["locale.country"] = country
@app.call(env)
end
private