class Translate::Storage
Attributes
locale[RW]
Public Class Methods
new(locale)
click to toggle source
# File lib/translate/storage.rb, line 5 def initialize(locale) self.locale = locale.to_sym end
Public Instance Methods
write_to_file()
click to toggle source
# File lib/translate/storage.rb, line 9 def write_to_file Translate::File.new(file_path).write(keys) end
Private Instance Methods
file_path()
click to toggle source
# File lib/translate/storage.rb, line 18 def file_path File.join(Translate.locales_dir, "#{locale}.yml") end
keys()
click to toggle source
# File lib/translate/storage.rb, line 14 def keys {locale => I18n.backend.send(:translations)[locale]} end