Class PoMessageSingular
In: app/models/po_message_singular.rb
Parent: PoMessage

gettext の複数形に依存しない翻訳対象のモデル。

Methods

Public Instance methods

複数形に依存するかどうかを返す。

[Source]

    # File app/models/po_message_singular.rb, line 47
47:   def plural?
48:     false
49:   end

.po ファイルでの文字列に変換する。

[Source]

    # File app/models/po_message_singular.rb, line 36
36:   def to_po_string
37:     return "msgid " + "#{msgctxt}#{msgid}".po_mangle + "\n"
38:   end

msgid を返す。 (idのみに依存するため to_po_string より速い。)

[Source]

    # File app/models/po_message_singular.rb, line 42
42:   def to_po_string_fast
43:     return "msgid \"DB|PoMessageSingular|#{id}|\"\n"
44:   end

翻訳を返す。

[Source]

    # File app/models/po_message_singular.rb, line 27
27:   def translation
28:     if modified? && User.current
29:       t = User.current.translation_class.find_by_po_message_id(id)
30:       return t.msgstr if t
31:     end
32:     return s_("#{msgctxt}#{msgid}")
33:   end

[Validate]