class HTTP::Accept::Language
- HTTP::Accept::Language
- Reference
- Object
Defined in:
http/accept/language.crConstant Summary
-
LANGUAGE =
/(?<language>#{LANGUAGE_RANGE})(#{WEIGHT})?/
-
LANGUAGE_ACCEPT =
/#{LANGUAGE},?/
-
LANGUAGE_RANGE =
/(?<locale>[a-zA-Z]{1,8}|\*)(-([a-zA-Z0-9]{1,8}|\*))*/
-
https://tools.ietf.org/html/rfc4647#section-2.1
-
QVALUE =
/0(\.[0-9]{0,3})?|1(\.0{0,3})/
-
https://tools.ietf.org/html/rfc7231#section-5.3.1
-
WEIGHT =
/\s*;\s*q=(?<qvalue>#{QVALUE})/
-
https://tools.ietf.org/html/rfc7231#section-5.3.1
Class Method Summary
- .best_locale(locales : Array(String), wanted_languages : Array(Value) | Nil, default_language = "en") : String
- .parse(text : String) : Array(Value)