Translations and 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
A package puts its catalogues in translations/, one file per language:
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 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 trg is de and the target is the German text. id and name repeat the key.
Keys
Keys are camelCase words separated by dots. Common prefixes:
nav.for entries of the navigation (nav.) andmy Days nav.for its groupsgroup. screen.for titles, labels and values on screens (screen.,model. code screen.)model. schedule Type. fixed notification.andtype.<key>. title notification.for notifications (see Notifications and Live Updates)type.<key>. body clock.for the clock of the attendance package
Prefix keys with the topic of the package.
Message format
Messages use ICU MessageFormat: placeholders in curly braces, plural and select for counts and alternatives:
<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
In PHP, inject Symfony\ and pass the placeholders as parameters:
$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:
import { translate } from '@adsum/core/i18n/translations.js';
const text = translate('clock.state.working.since', { time });
In Fluid templates, use the ViewHelper tt:. Further arguments are placeholders:
<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/ of each package, built from the XLIFF files, in the language
of the user's account with English as the fallback.
Check the catalogues
Build/ checks that all languages have the same keys and that every key
used in a template or component is defined.
Icons
The icons a package uses are listed in Build/:
[
"calendar-check",
"calendar-clock",
"repeat",
"settings-2"
]
Every name is a Lucide icon. An SVG file of the same name next to icons. replaces it or adds an own icon. The
build copies the icons to public/ of the package. An icon name can be used:
- as
iconof a navigation entry (see Navigation and Access) - as
iconof a row action of a screen (see Screens) - in a component, with
<wa-icon library="adsum" name="clock"></ wa- icon>