Module GettextSetup
In: lib/gettext-setup/gettext_setup.rb

Methods

Public Class methods

Returns the locale for the current machine. This is most useful for shell applications that need an ACCEPT-LANGUAGE header set.

`locales_path` should include:

  • config.yaml
  • a .pot file for the project
  • i18n directories for languages, each with a .po file
  • if using .mo files, an LC_MESSAGES dir in each language dir, with the .mo file in it

valid `options` fields: :file_format - one of the supported backends for fast_gettext (e.g. :po, :mo, :yaml, etc.)

Given an HTTP Accept-Language header return the locale with the highest priority from it for which we have a locale available. If none exists, return the default locale

[Validate]