Module: Gonzui::GetText

Included in:
CatalogRepository, GonzuiAbstractServlet, SearchQuery
Defined in:
lib/gonzui/gettext.rb

Instance Method Summary collapse

Instance Method Details

#gettext(text) ⇒ Object Also known as: _



14
15
16
17
# File 'lib/gonzui/gettext.rb', line 14

def gettext(text)
  return text unless @gettext_catalog
  return (@gettext_catalog[text] or text)
end

#gettext_noop(text) ⇒ Object Also known as: N_



20
21
22
# File 'lib/gonzui/gettext.rb', line 20

def gettext_noop(text)
  text
end

#load_catalog(file_name) ⇒ Object



29
30
31
# File 'lib/gonzui/gettext.rb', line 29

def load_catalog(file_name)
  return eval(File.read(file_name))
end

#set_catalog(catalog) ⇒ Object



25
26
27
# File 'lib/gonzui/gettext.rb', line 25

def set_catalog(catalog)
  @gettext_catalog = catalog
end