lib/traducto/base.rb in traducto-1.0.0 vs lib/traducto/base.rb in traducto-1.0.1

- old
+ new

@@ -19,11 +19,11 @@ lazy_translate if lazy_lookup? i18n_translate @base_key if translation_missing? - format_text if format? + format return @text.html_safe end private @@ -34,11 +34,22 @@ def controller request[:controller] end + def format + case @options[:format] + when :text then format_text + else format_base + end + end + def format? @options[:format] ? true : false + end + + def format_base + @text = @text.join("\n") if @text.is_a? Array end def format_text @text = [@text] if not @text.is_a? Array