class BabelishRnc::CSV2Strings

Attributes

languages[RW]

Public Instance Methods

extension() click to toggle source
# File lib/babelish_rnc/csv2strings.rb, line 26
def extension
  "strings"
end
get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "") click to toggle source
# File lib/babelish_rnc/csv2strings.rb, line 18
def get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "")
  entry = comment.to_s.empty? ? "" : "\n/* #{comment} */\n"
  
  row_value = row_value.to_s.empty? ? defaultlang : row_value
  
  entry + "\"#{row_key}\"" + " " * indentation + " = \"#{row_value}\";\n"
end
language_filepaths(language) click to toggle source
# File lib/babelish_rnc/csv2strings.rb, line 5
def language_filepaths(language)
  require 'pathname'
  filepaths = []
  if language.regions.empty?
    filepaths << Pathname.new(@output_dir) + "#{language.code}.lproj/#{output_basename}.#{extension}"
  else
    language.regions.each do |region|
      filepaths << Pathname.new(@output_dir) + "#{language.code}-#{region}.lproj/#{output_basename}.#{extension}"
    end
  end
  filepaths
end
output_basename() click to toggle source
# File lib/babelish_rnc/csv2strings.rb, line 30
def output_basename
  @output_basename || 'Localizable'
end