Method: GetText::POEntry#to_s
- Defined in:
- lib/gettext/po_entry.rb
#to_s(options = {}) ⇒ Object
Format the po entry in PO format.
Parameters:
- options (Hash) (defaults to: {})
Options Hash (options):
-
:include_translator_comment
(Bool)
— default:
true
—
Includes translator comments in formatted string if true.
-
:include_extracted_comment
(Bool)
— default:
true
—
Includes extracted comments in formatted string if true.
-
:include_reference_comment
(Bool)
— default:
true
—
Includes reference comments in formatted string if true.
-
:include_flag_comment
(Bool)
— default:
true
—
Includes flag comments in formatted string if true.
-
:include_previous_comment
(Bool)
— default:
true
—
Includes previous comments in formatted string if true.
-
:include_all_comments
(Bool)
— default:
true
—
Includes all comments in formatted string if true. Other specific
:include_XXXoptions get preference over this option. You can remove all comments by specifying this option as false and omitting other:include_XXXoptions. -
:max_line_width
(Integer)
— default:
78
—
Wraps long lines that is longer than the
:max_line_width. Don't break long lines if:max_line_widthis less than 0 such as-1. -
:use_one_line_per_reference
(Bool)
— default:
false
—
Whether each reference comment uses one line or not. If this is
true,:max_line_widthis ignored for reference comment. -
:encoding
(Encoding)
— default:
nil
—
Encodes to the specific encoding.
Raises:
169 170 171 172 173 174 |
# File 'lib/gettext/po_entry.rb', line 169 def to_s(options={}) raise(NoMsgidError, "msgid is nil.") unless @msgid formatter = Formatter.new(self, options) formatter.format end |