class I18n::Backends::Hash

Overview

Plain Hash backend.

It MUST be populated with data explicitly upon creation.

Defined in:

i18n/backends/hash.cr

Constructors

Instance methods inherited from class I18n::Backend

data : JSON::Any | YAML::Any | Nil data, load load, load_paths : Array(String) load_paths, translate(keys : Array(String), locale : String, count : Int32 | Nil = nil) translate

Class methods inherited from class I18n::Backend

quantity_key_procs : Hash(String, QuantityKeyProc) quantity_key_procs

Constructor Detail

def self.new(data) #

Initializes a backend and loads it with data (it MUST be a Hash).

backend = I18n::Backends::Hash.new.tap { |b| b.load({"foo" => "bar"}) }

TODO Find a way to implement this without external parsers.


[View source]