Sha256: db3f3011f0cad1a1415180fe66dc770b764c19882bd0a56802e3d5d698eefc7c
Contents?: true
Size: 1.03 KB
Versions: 4
Compression:
Stored size: 1.03 KB
Contents
module PolyglotIos module Serializer module Source class TranslationCase include Helper::General attr_accessor :name attr_accessor :value attr_accessor :translation def initialize(name, value, translation = nil) @name = name @value = value @translation = translation end def serialized() clean_name = clean_case_name(name) "public static let #{clean_name}: Strings = \"#{value}\"" end def serializedDefaultTranslation() if !translation.nil? return format_translation_as_comment(translation) end return "" end def format_translation_as_comment(translation) lines = translation.lines lines.each_with_index.map do |line, index| if index == 0 "/// Value: #{line.chomp}" else "\t/// #{line.chomp}" end end.join("\n") end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems