With lang attribute
The component is used on translated pages that don’t have a translation for the text strings. This means that it could display the fallback English string if the translate method can’t find an appropriate translation. This makes sure that the lang can be set to ensure that browsers understand which parts of the page are in each language.
The lang attribute must be set to a valid BCP47 string. A valid code can be the two or three letter language code - for example, English is en
or eng
, Korean is ko
or kor
- but if in doubt please check.
How it looks (preview)
Ein gweinidogion
How to call this example
<%= render "govuk_publishing_components/components/heading", {
text: "Ein gweinidogion",
lang: "cy"
} %>