# I18n

Poetry's interface strings ride I18n keys under poetry.* - override the shipped en.yml per key, add locales with fallbacks, and keep visible copy in your own templates; form labels and errors localize through the model layer.

Poetry splits translation duty: the library's interface strings (accessible names like Close and Clear selection, empty and loading states, screen-reader counts) resolve through I18n under `poetry.<component>.<key>`, shipped in poetry-ui's `config/locales/en.yml` - the complete `poetry.*` key list, loaded by engine convention, with standard pluralization and `%{}` interpolation. Host locale files load after the engine's, so redefining a key overrides it per key; add a language by shipping the `poetry.*` keys for that locale, and set `config.i18n.fallbacks = [:en]` so a key you have not translated yet reads the shipped English instead of rendering a translation-missing marker. Visible copy is never a library key: `label:`, `placeholder:`, `empty_text:`, and `filter_label:` are options with English zero-config defaults (DatePicker's "Pick a date") - pass `t(".key")` translations at call sites; components you author on `Poetry::Core::Component` get relative `t(".key")` lookup scoped by class name, reshaped by assigning ViewComponent's own `self.virtual_path=`. The FormBuilder derives labels from `human_attribute_name` (the `activerecord.attributes.*` keys you already maintain), validation messages ride Active Model's own I18n chain, and hints/placeholders resolve from `poetry_form.{hints,placeholders}.<model>.<attribute>` (then a `defaults` rung) with the same keys under `simple_form.*` as a fallback - a migrating app's locale files keep working - and `hint:`/`placeholder:` arguments override both. DateField and TimeField segment names and placeholders live under `poetry.date_field.*`; Calendar is locale-aware end to end - the weekday header derives from `date.abbr_day_names`, the caption and month dropdown read `date.month_names` (the names ride a Stimulus value, so client-side navigation stays localized), and the dropdown's screen-reader labels live at `poetry.calendar.*`.
