Sha256: 2023c729d33eb9633d9fe1d500dabd2f26bc711effe64c02a372639f2aff434f

Contents?: true

Size: 548 Bytes

Versions: 10

Compression:

Stored size: 548 Bytes

Contents

class Translate::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
  
  def self.file_paths(locale)
    Dir.glob(File.join(root_dir, "config", "locales", "**","#{locale}.yml"))
  end
  
  def self.root_dir
    Rails.root
  end
  
  private
  def keys
    {locale => I18n.backend.send(:translations)[locale]}
  end
  
  def file_path
    File.join(Translate::Storage.root_dir, "config", "locales", "#{locale}.yml")
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
translate-rails3-plus-0.0.14 lib/translate/storage.rb
translate-rails3-plus-0.0.13 lib/translate/storage.rb
translate-rails3-plus-0.0.12 lib/translate/storage.rb
translate-rails3-0.4.0 lib/translate/storage.rb
translate-rails3-0.2.3 lib/translate/storage.rb
translate-rails3-0.2.2 lib/translate/storage.rb
translate-rails3-0.2.0 lib/translate/storage.rb
translate-rails3-0.1.2 lib/translate/storage.rb
translate-rails3-0.1.1 lib/translate/storage.rb
translate-rails3-0.1.0 lib/translate/storage.rb