---
title: "Translations and Icons"
manual: "adsum by web-vision"
version: "main"
permalink: "https://docs.typo3.org/permalink/web-vision/adsum-monorepo:extending-translations-icons@main"
source: "Extending/TranslationsAndIcons.rst"
rendered: "2026-11-07T02:01:32+00:00"
---

# Translations and Icons {#extending-translations-icons}

Every text of the interface exists in English and German, in XLIFF catalogues used by PHP, Fluid templates and the
TypeScript frontend. Icons come from the Lucide icon set or from the package.

## Catalogues {#catalogues}

A package puts its catalogues in `translations/`, one file per language:

```text
packages/web-vision/adsum-working-time/translations/
    messages+intl-icu.en.xlf
    messages+intl-icu.de.xlf
```

Both files have exactly the same keys; English is the fallback. The files are XLIFF 2.0, one `<unit>` per message,
with the key as `source` and the text as `target`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="en">
  <file id="messages">
    <unit id="nav.myWorkingDays" name="nav.myWorkingDays">
      <segment>
        <source>nav.myWorkingDays</source>
        <target>My working days</target>
      </segment>
    </unit>
  </file>
</xliff>
```

In the German file `trgLang` is `de` and the `target` is the German text. `id` and `name` repeat the key.

## Keys {#keys}

Keys are camelCase words separated by dots. Common prefixes:

-   `nav.` for entries of the navigation (`nav.myDays`) and `nav.group.` for its groups
-   `screen.` for titles, labels and values on screens (`screen.model.code`, `screen.model.scheduleType.fixed`)
-   `notification.type.<key>.title` and `notification.type.<key>.body` for notifications (see
    [Notifications and Live Updates](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:extending-events-notifications@main))
-   `clock.` for the clock of the attendance package

Prefix keys with the topic of the package.

## Message format {#message-format}

Messages use ICU MessageFormat: placeholders in curly braces, `plural` and `select` for counts and alternatives:

```xml
<target>{count, plural, one {# missing punch in your team} other {# missing punches in your team}}</target>
<target>{requesterName} and {colleagueName} swapped, {approved, select, yes {approved} other {rejected}}.</target>
```

## Use translations {#use-translations}

In PHP, inject `Symfony\Contracts\Translation\TranslatorInterface` and pass the placeholders as parameters:

```php
$text = $this->translator->trans('notification.type.time.workOnAbsence.body', ['employeeName' => $name, 'date' => $date], 'messages', $locale);
```

In TypeScript, `translate()` takes the key and the values of the placeholders:

```typescript
import { translate } from '@adsum/core/i18n/translations.js';

const text = translate('clock.state.working.since', { time });
```

In Fluid templates, use the ViewHelper `tt:translate`. Further arguments are placeholders:

```html
<html data-namespace-typo3-fluid="true"
      xmlns:tt="http://typo3.org/ns/WebVision/Adsum/Core/Shared/View/ViewHelpers">
<tt:translate key="screen.model.title"/>
<tt:translate key="notification.type.time.workOnAbsence.body" employeeName="{name}" date="{date}"/>
</html>
```

The frontend loads `public/translations/<locale>.json` of each package, built from the XLIFF files, in the language
of the user's account with English as the fallback.

## Check the catalogues {#check-the-catalogues}

`Build/Scripts/runTests.sh -s checkIntegrityXliff` checks that all languages have the same keys and that every key
used in a template or component is defined.

## Icons {#icons}

The icons a package uses are listed in `Build/Sources/Icons/<package>/icons.json`:

```json
[
    "calendar-check",
    "calendar-clock",
    "repeat",
    "settings-2"
]
```

Every name is a Lucide icon. An SVG file of the same name next to `icons.json` replaces it or adds an own icon. The
build copies the icons to `public/icons/<name>.svg` of the package. An icon name can be used:

-   as `icon` of a navigation entry (see [Navigation and Access](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:extending-navigation-access@main))
-   as `icon` of a row action of a screen (see [Screens](https://docs.typo3.org/permalink/web-vision/adsum-monorepo:extending-screens@main))
-   in a component, with `<wa-icon library="adsum" name="clock"></wa-icon>`
