enum

Cl8r::I18n::Locale

Inherits Enum < Comparable < Value < Object

Supported application locales.

Constants

En = 0
EsMX = 1

Constructors

parse(raw : String | Nil) : Locale

Parses a raw string into a supported Locale, or defaults to En.

Source
resolve(cli_arg : String | Nil = nil, config_lang : String | Nil = nil) : Locale

Resolves the active locale by checking:

  1. Explicit CLI argument (if provided)
  2. Configured user setting in config.yaml
  3. Environment variables ($CL8R_LANG, $LC_ALL, $LC_MESSAGES, $LANG)
  4. Fallback default: English (En)
Source

Instance methods

en?

Returns true if this enum value equals En

Source
es_mx?

Returns true if this enum value equals EsMX

Source
spanish?

Returns whether the locale represents Spanish

Source
tag

Returns the canonical language tag (e.g. 'en', 'es-MX')

Source