| Module | GetText::ErbContainer |
| In: |
lib/gettext/erb.rb
|
This module provides basic functions to evaluate plural ERB files(.rhtml) in a TextDomain. You need to implement a class which includes GetText::ErbContainer.
See simple examples below:
require 'gettext/erb'
class SimpleContainer
include GetText::ErbContainer
def initialize(domainname, domainpath = nil, locale = nil, charset = nil)
bindtextdomain(domainname, domainpath, locale)
end
end
container = SimpleContainer.new("helloerb1", "locale")
puts container.eval_file("/your/erb/file.rhtml")
This module is an example for template engines such as ERB. You can implement another implementation easily to read gettext/erb.rb.
Evaluates ERB file in the instance and returns the result HTML.
Evaluates ERB source(String) in the instance and returns the result HTML.