Class: TranslationBuffer
- Inherits:
-
String
show all
- Defined in:
- lib/amelia/active_support/core_ext/translation_buffer.rb
Defined Under Namespace
Classes: TranslationConcatError
Instance Method Summary
collapse
Methods inherited from String
#to_squawk
Constructor Details
Returns a new instance of TranslationBuffer.
7
8
9
10
11
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 7
def initialize(*)
@translate_flag = true
@options = {}
super
end
|
Instance Method Details
#internationalization(virtual_path = nil) ⇒ Object
Also known as:
i18n
28
29
30
31
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 28
def internationalization virtual_path = nil
@virtual_path = virtual_path
translate_flag? ? translate(self, @options).translate_false : self
end
|
#internationalization_options(options = {}) ⇒ Object
Also known as:
io
16
17
18
19
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 16
def internationalization_options options = {}
@options = options
self
end
|
35
36
37
38
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 35
def to_s
self
end
|
#translate_false ⇒ Object
23
24
25
26
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 23
def translate_false
@translate_flag = false
self
end
|
#translate_flag? ⇒ Boolean
12
13
14
|
# File 'lib/amelia/active_support/core_ext/translation_buffer.rb', line 12
def translate_flag?
defined?(@translate_flag) && @translate_flag
end
|