| Class | HttpAcceptLanguage::Parser |
| In: |
lib/http_accept_language/parser.rb
|
| Parent: | Object |
| header | [RW] |
Returns the first of the user_preferred_languages that is compatible with the available locales. Ignores region.
Example:
request.compatible_language_from I18n.available_locales
Returns the first of the user preferred languages that is also found in available languages. Finds best fit by matching on primary language first and secondarily on region. If no matching region is found, return the first language in the group matching that primary language.
Example:
request.language_region_compatible(available_languages)
Finds the locale specifically requested by the browser.
Example:
request.preferred_language_from I18n.available_locales # => 'nl'
Returns a supplied list of available locals without any extra application info that may be attached to the locale for storage in the application.
Example: