Module: Localite

Extended by:
Settings, Translate
Defined in:
lib/localite.rb,
lib/localite.rb,
lib/localite/storage.rb

Overview

This is a really simple template and translation engine.

TODO: Use erubis instead of this simple engineā€¦

Defined Under Namespace

Modules: Backend, Etest, Filter, Format, NodeFilter, Settings, StringAdapter, SymbolAdapter, Translate Classes: Scopes, Template

Class Method Summary collapse

Methods included from Settings

base, current_format, current_format=, current_locale, current_locale=, current_scope, format, inspect, locale, scope, scope!

Methods included from Translate

translate

Class Method Details

.loggerObject

a logger



24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/localite.rb', line 24

def self.logger
  return @logger if @logger
  
  klass = defined?(ActiveSupport) ? ActiveSupport::BufferedLogger : Logger

  @logger = begin
    klass.new("log/localite.log")
  rescue Errno::ENOENT
    ::Logger.new(STDERR)
  end
  
  @logger.warn "=== Initialize localite logging: #{Time.now}"
  @logger
end