Sha256: 1cc0deaa3ac1b6915d7e5a304797e7c139a5cd5fb2d2ffe758a3e1b8093cfddf

Contents?: true

Size: 394 Bytes

Versions: 28

Compression:

Stored size: 394 Bytes

Contents

module Translate
  class Storage
    attr_accessor :locale

    def initialize(locale)
      self.locale = locale.to_sym
    end

    def write_to_file
      Translate::File.new(file_path).write(keys)
    end

    private
    def keys
      {locale => I18n.backend.send(:translations)[locale]}
    end

    def file_path
      File.join(Translate.locales_dir, "#{locale}.yml")
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
refinerycms-i18n-5.0.1 lib/translate/storage.rb
refinerycms-i18n-5.0.0 lib/translate/storage.rb
refinerycms-i18n-4.0.2 lib/translate/storage.rb
refinerycms-i18n-4.0.1 lib/translate/storage.rb
refinerycms-i18n-3.0.2 lib/translate/storage.rb
refinerycms-i18n-4.0.0 lib/translate/storage.rb
refinerycms-i18n-3.0.1 lib/translate/storage.rb
refinerycms-i18n-3.0.0 lib/translate/storage.rb
refinerycms-i18n-2.1.0 lib/translate/storage.rb
refinerycms-i18n-2.0.2 lib/translate/storage.rb
refinerycms-i18n-2.0.0 lib/translate/storage.rb
refinerycms-i18n-1.0.0 lib/translate/storage.rb
refinerycms-i18n-0.9.9.16 lib/translate/storage.rb
refinerycms-i18n-0.9.9.15 lib/translate/storage.rb
refinerycms-i18n-0.9.9.14 lib/translate/storage.rb
refinerycms-i18n-0.9.9.13 lib/translate/storage.rb
refinerycms-i18n-0.9.9.12 lib/translate/storage.rb
refinerycms-i18n-0.9.9.10 lib/translate/storage.rb
refinerycms-i18n-0.9.9.9 lib/translate/storage.rb
refinerycms-i18n-0.9.9.8 lib/translate/storage.rb