ActionView::Helpers::TranslationHelper
translate
API docs (Rails 8.1.4.1) ↗Alias: t
def translate(key, **options, &block)
Description
Looks up and returns the translation for a key.
ERB
Changes from the previous output: Added Removed Changed
config/locales/examples/en.yml
en:
hello: "Hello"
greeting: "Hello, %{name}"
welcome_html: "Welcome, <b>%{name}</b>"
messages:
one: "You have 1 message"
other: "You have %{count} messages"
articles:
index:
title: "Articles"
HTML
Preview
Form submission
Form data
| name | value |
|---|
Request body
Content-Type:
params