Sha256: 9060ca4bda3722209d98e7cb682359cc729eb0d50963e2dc32f0a95e44857a36

Contents?: true

Size: 793 Bytes

Versions: 3

Compression:

Stored size: 793 Bytes

Contents

# Add support for localization keys
require 'rails/core_ext'
require 'globalite/l10n'
require 'globalite/locale'
Symbol.send :include, SymbolExtension

module Globalite
  extend L10n
  def self.localize_rails
    ActiveRecord::Errors.relocalize
    ActionController::Base.relocalize
  end
end

# Localize Rails
require 'rails/localization.rb'
require 'rails/localized_action_view'
require 'rails/localized_action_controller'
require 'rails/localized_active_record'

# added Boolean function to 'boolean' a string
module Kernel
  def Boolean(string)
    return true if string == true || string =~ /^true$/i
    return false if string == false || string.nil? || string =~ /^false$/i
    raise ArgumentError.new("invalid value for Boolean: \"#{string}\"")
  end
end

Globalite.load_localization!

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
edgerunner-globalite-0.5.1 lib/globalite.rb
mattetti-globalite-0.5.1 lib/globalite.rb
morhekil-globalite-0.5.1 lib/globalite.rb