Method: GetText::POEntry::Formatter#initialize
- Defined in:
- lib/gettext/po_entry.rb
#initialize(entry, options = {}) ⇒ Formatter
Returns a new instance of Formatter.
Parameters:
-
entry
(POEntry)
—
The entry to be formatted.
- 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.
290 291 292 293 |
# File 'lib/gettext/po_entry.rb', line 290 def initialize(entry, options={}) @entry = entry @options = normalize_options(options) end |