PHPackages                             dnadesign/silverstripe-audio-definition - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. dnadesign/silverstripe-audio-definition

ActiveSilverstripe-vendormodule[Image &amp; Media](/categories/media)

dnadesign/silverstripe-audio-definition
=======================================

Provides the models and interface to include keywords audio definition in content

2.0.3(1y ago)2717BSD-3-ClausePHP

Since Sep 1Pushed 1y ago6 watchersCompare

[ Source](https://github.com/dnadesign/silverstripe-audio-definition)[ Packagist](https://packagist.org/packages/dnadesign/silverstripe-audio-definition)[ RSS](/packages/dnadesign-silverstripe-audio-definition/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (15)Used By (0)

Keywords text + audio definition for SilverStripe
=================================================

[](#keywords-text--audio-definition-for-silverstripe)

Introduction
------------

[](#introduction)

This modules provides an interface to associate foreign words, within a content area, with an audio description and optional text definition. By Default, this module ships with the necessary interfaces for translating Te Reo Maori words and expressions via the  API.

Requirements
------------

[](#requirements)

- SilverStripe 5
- maoridictionary.co.nz API key (if using the default Te Reo Maori API)

Installation
------------

[](#installation)

```
composer require dnadesign/silverstripe-audio-definition

```

How to
------

[](#how-to)

### Create Definitions

[](#create-definitions)

In the CMS, open the Audio Definition interface, and click on `Add New`. Type in the terms (could be one or more words) and select the language they are in (by default, only option is Maori).

If you are using an API and it is set up correctly, the `Link to Audio file` and `Text Definitions` should be populated upon saving. If no API is provided, you can add `Text Definitions` manually.

[![](docs/en/_images/audio-definition-cms-section.png)](docs/en/_images/audio-definition-cms-section.png)[![](docs/en/_images/saved-audio-definition.png)](docs/en/_images/saved-audio-definition.png)

### Insert definitions in a content area

[](#insert-definitions-in-a-content-area)

This module adds a button to the default Silverstripe text editor (currently TinyMCE 6) allowing a user to insert a shortcode which renders the audio definition. To add the shortcode, select the word you wish to associate with the definition, click on the `audio defnintion` button and select the correct term. If the selected text matches any of the audio definition term, it will be selected by default.

[![](docs/en/_images/audio-definition-wysiwyg.jpeg)](docs/en/_images/audio-definition-wysiwyg.jpeg)

### Customise definition appearance

[](#customise-definition-appearance)

By default, the rendered definition is a `span` with the correct `lang` attribute set. In addition, if an audio file is supplied, a button will precede the word which will play the audio when clicked.

It is recommended that you override the `DNADesign\AudioDefinition\AudioDefinition` template to suit you needs. For instance, you could add the text definition in a tooltip displayed when a user hovers over the word.

As an example, this is the markup you could use with [tippy.js](https://atomiks.github.io/tippyjs/)

```

    $Content.RAW

        $SVG('cross')

            $SVG('speaker')
            $Term

                    $Content.RAW
                    $Top.LanguageName | $Type

    $Content.RAW

```

### Add different languages/translators

[](#add-different-languagestranslators)

If you would like to add a different language to choose from when creating a definition, you can add a new locale to the AudioDefinition sources via the config:

```
DNADesign\AudioDefinition\Models\AudioDefinition:
  sources:
    es_ES: 'SpanishTranslationServiceClass'

```

A translation service is optional. If you choose to use one, you can create a new service which must implement `DNADesign\AudioDefinition\Services`. This class must define a method `getDefinitionAndAudio` which returns an array that must contain:

```
$data = [
    'audioSrc' => 'Link to audio file',
    'definitions' => [
        [
            'id' => 'Unique id of the definition (optional),
            'type' => 'Eg: noun, verb (optional),
            'content' => 'The text definition'
        ]
    ]
]

```

Extensions
----------

[](#extensions)

### Context Extension

[](#context-extension)

Some languages can have multiple text definitions for the same word depending on the context. To tag different text definitions with keywords that depict a context, activate the context extension for the locale as follows:

```
DNADesign\AudioDefinition\Models\TextDefinition:
  use_context_for_locales:
    - mi_NZ

```

Once activated, users can create contexts in the Audio Definition &gt; Contexts tab, then tag text definitions with one or more contexts. This won't have an influence on the way the definitions are displayed out-of-the-box, but if you implement a way of displaying the text definitions, then these can be filtered by context.

**Note**: if at least one text definition is tagged with a context, the wysiwyg dropdown will give the choice of word with a context. If a word is required to display all definitions, then each definition will need to be tagged with the "default" context.

**Note**: if you add the context config before running dev/build after installing the module, you will need to run dev/build twice for all the tables to be created.

NOTES
-----

[](#notes)

Icons made by [Pixel perfect](https://www.flaticon.com/authors/pixel-perfect) from [www.flaticon.com](https://www.flaticon.com/)

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~108 days

Recently: every ~92 days

Total

12

Last Release

519d ago

Major Versions

1.0.5 → 2.0.02023-12-07

1.x-dev → 2.0.22024-02-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/efd88fa106982bcf2e3cd689e6a37d352c54308d14dedeac4ac477a47a432363?d=identicon)[DNADesign](/maintainers/DNADesign)

![](https://www.gravatar.com/avatar/e55a584eaac053bdbe811b1039dd00ac30da0c7978a5efbb6082504c610678d2?d=identicon)[alex-dna](/maintainers/alex-dna)

---

Top Contributors

[![alex-dna](https://avatars.githubusercontent.com/u/6982515?v=4)](https://github.com/alex-dna "alex-dna (30 commits)")[![Cambis](https://avatars.githubusercontent.com/u/12287346?v=4)](https://github.com/Cambis "Cambis (2 commits)")[![djmattski](https://avatars.githubusercontent.com/u/3836638?v=4)](https://github.com/djmattski "djmattski (2 commits)")[![lukereative](https://avatars.githubusercontent.com/u/1415622?v=4)](https://github.com/lukereative "lukereative (2 commits)")[![jalamanderman](https://avatars.githubusercontent.com/u/33302399?v=4)](https://github.com/jalamanderman "jalamanderman (1 commits)")[![jules0x](https://avatars.githubusercontent.com/u/8979741?v=4)](https://github.com/jules0x "jules0x (1 commits)")

---

Tags

translationsilverstripeaudiodefinition

### Embed Badge

![Health badge](/badges/dnadesign-silverstripe-audio-definition/health.svg)

```
[![Health](https://phpackages.com/badges/dnadesign-silverstripe-audio-definition/health.svg)](https://phpackages.com/packages/dnadesign-silverstripe-audio-definition)
```

###  Alternatives

[silverstripe/framework

The SilverStripe framework

7213.5M2.5k](/packages/silverstripe-framework)[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

92421.6k26](/packages/tractorcow-silverstripe-fluent)[heyday/silverstripe-responsive-images

Configure and send a series of image size options to the client without loading any resources until a media query can be executed.

5387.7k6](/packages/heyday-silverstripe-responsive-images)[andrewhoule/silverstripe-photogallery

Creates a basic photo gallery pagetype with albums and photos. Photos within albums are opened with a lightbox.

117.0k1](/packages/andrewhoule-silverstripe-photogallery)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
