module Archangel

Archangel

@author dfreerksen

@see Archangel

@see Archangel

Constants

LANGUAGES

Available languages constant

LANGUAGE_DEFAULT

Default language constant

ROLES

Available roles constant

ROLE_DEFAULT

Default role constant

THEMES

Theme names constant

THEME_DEFAULT

Default theme constant

THEME_DIRECTORIES

Theme directories constant

VERSION

Archangel gem version

Public Class Methods

config() click to toggle source

Application configurations

Example

Archangel.config.backend_path #=> "backend"
Archangel.config[:backend_path] #=> "backend"
Archangel.config["backend_path"] #=> "backend"

@return [Object] application configurations

# File lib/archangel.rb, line 66
def config
  @config ||= Config.new
end
Also aliased as: configuration
configuration()
Alias for: config
reserved_page_keywords() click to toggle source

Reserved keywords for page slugs

This is an array keywords that are not allowed to be used for Page slugs.

Example

Archangel.reserved_page_keywords #=> ["auth", "backend", ""]

@return [Array] reserved keywords for page slugs

# File lib/archangel.rb, line 92
def reserved_page_keywords
  %i[auth_path backend_path frontend_path]
end
t(*args)
Alias for: translate
themes() click to toggle source

Available themes

Example

Archangel.themes #=> ["default"]
Archangel.themes #=> ["default", "my_theme"]

@return [Array] available themes

# File lib/archangel.rb, line 79
def themes
  [THEME_DEFAULT] + THEMES
end
translate(*args) click to toggle source

Translate

Example

# config/locales/en.yml
en:
  archangel:
    hello: Hello
    foo:
      bar: Bar

Archangel.translate(:hello) #=> "Hello"
Archangel.translate(:bar, scope: :foo) #=> "Bar"
Archangel.t(:hello) #=> "Hello"
Archangel.t(:bar, scope: :foo) #=> "Bar"
I18n.t(:hello, scope: :archangel) #=> "Hello"
I18n.translate(:hello, scope: :archangel) #=> "Hello"

@param args [String,Array] translation parameters @return [String] the translated string

Calls superclass method
# File lib/archangel/i18n.rb, line 35
def translate(*args)
  options = args.extract_options!
  options[:scope] = [*options[:scope]].unshift(:archangel)
  args << options

  super(*args)
end
Also aliased as: t
version() click to toggle source

Archangel version

@return [String] current version

# File lib/archangel/version.rb, line 17
def self.version
  VERSION
end