Method: ApiDoc::ApplicationHelper#tr

Defined in:
app/helpers/api_doc/application_helper.rb

#tr(slug, *args) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'app/helpers/api_doc/application_helper.rb', line 34

def tr(slug, *args)
  path = %w{api_doc page}
  no_slug_path = path.dup
  path << slug
  path << args
  no_slug_path << args
  path.flatten!
  no_slug_path.flatten!
  t(path.flatten.join("."), default: t(no_slug_path.join('.'), default: ""))
end