Class: Graphiti::LocaleGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/graphiti/locale_generator.rb

Constant Summary collapse

ERROR_TITLES =

Every code Graphiti renders a title for, and the title it renders today.

{
  bad_request: "Request Error",
  not_found: "Not Found",
  conflict: "Conflict Error",
  unprocessable_entity: "Validation Error",
  internal_server_error: "Internal Server Error"
}.freeze
ERROR_SOURCES =

The two codes no registration produces.

{
  unprocessable_entity: ["a write that failed model validations"],
  internal_server_error: ["any exception Graphiti did not register"]
}.freeze
ERROR_DETAILS =

Written into the app's locale file, not defaulted in Graphiti.

{
  internal_server_error: "We've probably received an error report already, but please contact us if the issue persists."
}.freeze
COMMENT_WIDTH =
68

Instance Method Summary collapse

Instance Method Details

#locale ⇒ Object



34
35
36
# File 'lib/generators/graphiti/locale_generator.rb', line 34

def locale
  template("locale.yml.erb", File.join("config/locales", "graphiti.en.yml"))
end