Class: ActionMailer::Base
- Inherits:
-
Object
- Object
- ActionMailer::Base
- Extended by:
- GetText::Rails
- Includes:
- GetText::Rails
- Defined in:
- lib/gettext/rails.rb
Overview
:nodoc:
Constant Summary
Constants included from GetText::Rails
Constants included from GetText
GetText::CACHE_BOUND_TARGET_MAX_SIZE, GetText::VERSION
Instance Method Summary collapse
- #base64(text, charset = "iso-2022-jp", convert = true) ⇒ Object
-
#create!(*arg) ⇒ Object
:nodoc:.
-
#create_without_gettext! ⇒ Object
:nodoc:.
Methods included from GetText::Rails
_bindtextdomain, available_locales, bindtextdomain, included, normalized_locale
Methods included from GetText
N_, #Nn_, _, #add_default_locale_path, bindtextdomain, #bindtextdomain_to, bound_target, bound_targets, cached=, cached?, cgi, cgi=, clear_cache, create_mofiles, current_textdomain_info, each_textdomain, find_targets, gettext, included, locale, locale=, msgmerge, msgmerge_all, n_, ngettext, #npgettext, ns_, nsgettext, output_charset, output_charset=, p_, pgettext, remove_all_textdomains, rgettext, rmsgfmt, rmsgmerge, s_, set_cgi, set_locale, set_locale_all, set_output_charset, setlocale, sgettext, textdomain, #textdomain_to, update_pofiles
Instance Method Details
#base64(text, charset = "iso-2022-jp", convert = true) ⇒ Object
466 467 468 469 470 471 472 473 474 |
# File 'lib/gettext/rails.rb', line 466 def base64(text, charset="iso-2022-jp", convert=true) if convert if charset == "iso-2022-jp" text = NKF.nkf('-j -m0', text) end end text = TMail::Base64.folding_encode(text) "=?#{charset}?B?#{text}?=" end |
#create!(*arg) ⇒ Object
:nodoc:
476 477 478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/gettext/rails.rb', line 476 def create!(*arg) #:nodoc: create_without_gettext!(*arg) if Locale.get.language == "ja" require 'nkf' @mail.subject = base64(@mail.subject) part = @mail.parts.empty? ? @mail : @mail.parts.first if part.content_type == 'text/plain' part.charset = 'iso-2022-jp' part.body = NKF.nkf('-j', part.body) end end @mail end |
#create_without_gettext! ⇒ Object
:nodoc:
464 |
# File 'lib/gettext/rails.rb', line 464 alias :create_without_gettext! :create! |