Klenodexempel

Plugin Reference

IntlPlugin

IntlPlugin parses Haml translation companions and lets Haml components receive locale-keyed translation data.

Companion Files

Intl files are companions to Haml modules.

components/Greeting.haml
components/Greeting.intl.en.toml
components/Greeting.intl.sv.toml

HamlPlugin asks the build context for a plugin that responds to translations_for. If IntlPlugin is absent, Haml still compiles and receives an empty translation map.

Framework Responsibility

Locale negotiation, missing-key behavior, interpolation, and helpers such as I18n.t(:title) are framework concerns. Klenod only provides the translation data collected from companion files.

Development Reloading

Adding, editing, or removing intl companions invalidates the owning Haml module, even when the companion file was not already in the dependency graph.