Strata\I18n\Locale

A localized language object that contains custom configuration and a language code.

    Synopsis

    class Locale {
    }

    Hierarchy

    Members

    protected

    • $code — string
    • $configuration — array
      The configuration cache.
    • $isDefault — boolean
    • $nativeLabel — string
    • $url — string

    Methods

    public

    • __construct() — A Locale requires a unique ISO $code and can be configured with any other custom values.
    • getCode() — Returns the locale code
    • getHomeUrl()
    • getMoFilePath() — Returns the PO file path either by default or for a specified environment
    • getNativeLabel() — Returns the locale label in its own translation.
    • getPoFilePath() — Returns the PO file path either by default or for a specified environment
    • getUrl() — Returns the unique Locale URL prefix.
    • hasACustomUrl()
    • hasANativeLabel() — Native labels being optional, this specifies whether this locale has a native label.
    • hasMoFile() — Specifies whether this locale has generated a .Mo file.
    • hasPoFile() — Specifies whether this locale has generated a .PO file.
    • isDefault() — Specifies whether this locale is the default one.

    Inherited from Strata\Core\StrataConfigurableTrait

    protected

    • normalizeConfiguration() — Normalizes the configuration cache. This will only run once on the object. It is mainly a safegard against a badly configured value cache.

    public

    • configure() — Instantiate the configuration cache to the state supplied by $config.
    • containsConfigurations() — Returns whether the configuration cache contains something.
    • extractConfig() — Intelligently extract data from the configuration array.
    • getConfig() — Fetches a value in the configuration array
    • getConfiguration() — Returns the object's complete configuration cache.
    • hasConfig() — Confirms the presence of a value in the custom post type's configuration array
    • setConfig() — Saves a value in the object's configuration array for the duration of the runtime.