module Lens

Defined in:

lens.cr

Constant Summary

VERSION = "0.1.0"

Class Method Summary

Class Method Detail

def self.fetch_backend(fmt : Formats) #

Returns the backend for the selected format

Please note that each backend has a different API for translations.

require "lens"

Lens.fetch_backend(Lens::Formats::GettextPO).as(Gettext::POBackend.class)      # => Gettext::POBackend
Lens.fetch_backend(Lens::Formats::GettextMO).as(Gettext::MOBackend.class)      # => Gettext::MOBackend
Lens.fetch_backend(Lens::Formats::CrystalI18nYAML).as(CrystalI18n::I18n.class) # => CrystalI18n::I18n

DEPRECATED Please just call the respective backends instead!


[View source]