Search by

daun / statamic-bard-languages

daun

Mark foreign-language words and sections of Statamic content

Package info

github.com/daun/statamic-bard-languages

Language:TypeScript

Type:statamic-addon

pkg:composer/daun/statamic-bard-languages

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-11-22 23:41 UTC

This package is auto-updated.

Last update: 2026-11-23 11:27:52 UTC


README

Mark words and sections of Bard content as written in another language.

Language menu marking an Arabic block in a Bard field

How it works

Editors pick a language for a phrase or a whole block. The addon adds a lang attribute, plus a dir attribute derived from the language. Screen readers, hyphenation, spell checkers, translation tools, and fonts all use the lang attribute to handle text correctly. Right-to-left passages render correctly in a left-to-right page.

Say
  <span lang="fr" dir="ltr">bonjour</span>
or
  <span lang="ar" dir="rtl">مرحبا</span>.

Quick start

Install the addon

composer require daun/statamic-bard-languages

Add the button

Add the language button to a Bard field, either in the blueprint editor or in its YAML:

type: bard
buttons:
  - bold
  - italic
  - language

Render the content

Nothing to do. Bard outputs the lang and dir attributes like any other markup.

{{ content }}

Documentation

Read the detailed documentation for how selections are marked, language suggestions, restricting languages, and text direction.

License

MIT