class Sy18nc::Synchronizer

Public Class Methods

new(*files) click to toggle source
# File lib/sy18nc/synchronizer.rb, line 3
def initialize(*files)
  @options = files.sy18nc_extract_options!
  @path, @base, *@locales = files

  @path = File.expand_path(@path)

  @base = Locale.new("#{@path}/#{@base}")

  @locales = @locales.map do |tfile|
    Locale.new("#{@path}/#{tfile}")
  end
end

Public Instance Methods

synchronize_all() click to toggle source
# File lib/sy18nc/synchronizer.rb, line 16
def synchronize_all
  @locales.each do |locale|
    if locale.synchronizable?
      locale.synchronize(@base)
      locale.save(@options.merge(filename: "#{@path}/#{locale.name}"))
    end
  end
end