Translations
Translations Documentation
This document outlines how translation files are to be used in view files.
YAML Syntax
A translation file should follow this structure:
Global Translations
Global translations should use the en.yml file
Usage example (config/locales/en.yml):
en: hello: "Hello" welcome_message: "Welcome to our application!"Component-Specific Translations
Component specific translations can be put either in the config/locales/components folder or inside the respective component folder
Usage example (config/locales/components/form_entry.yml):
en: form_entry: type_here: "Type here"pt: form_entry: type_here: "Digite aqui"Usage inside the view (form_entry.html.erb)
<%= t(".type_here") %>Usage inside a ViewComponent (form_entry.rb)
class FormEntry < LoopComponent def placeholder_text t(".type_here") endend