Dark Light
System
Default LBBW Jira Confluence Source Code
Share
Playground

Internationalization #

The aFP Design System include a built-in internationalization (i18n) system to make the UI available in multiple languages. You can set the active language, provide your own translations, and remove or override existing ones — without rebuilding the application.


Change language #

The selected language only applies to this browser tab and for the current session. When you close the tab or open the documentation in a new tab, the language will reset to its default.

Note that this setting only changes the language of the UI components (such as ARIA labels and other accessibility-related texts), not the language of the overall documentation content.

Deutsch
Setzt die Sprache auf Deutsch (nur ARIA-Labels & UI-Texte).
de
English
Sets language to English (ARIA labels & UI texts).
en

How it works #

The i18n system stores translation dictionaries for each language. When a component needs to display text, it looks up the correct translation for the current language. If no translation is found for the active language, the fallback language (en by default) is used.

You can:

All components that are registered for i18n will automatically re-render when the language changes.


Functions #

Set language #

setAfpLanguage(code: string) #

Sets the active language for all i18n-enabled components.

import { setAfpLanguage } from '@afp-design-system/core';

setAfpLanguage('de'); // Switches to German
setAfpLanguage('en'); // Switches to English

Get language #

getAfpLanguage(): string #

Returns the language currently in use. If no language has been set yet, it will:

  1. Try to detect the browser's preferred language.
  2. Use the fallback language (en) if detection fails.
import { getAfpLanguage } from '@afp-design-system/core';

console.log(getAfpLanguage()); // e.g. "en"

Register translation #

registerAfpTranslation(code: string, dict: AfpTranslationDict) #

Adds or overrides translations for one language.

import { registerAfpTranslation } from '@afp-design-system/core';

registerAfpTranslation('fr', {
  'afp-badge.aria-label': 'Badge de statut'
});

Register multiple translations #

registerAfpTranslations(bundle: AfpTranslation) #

Adds or overrides translations for multiple languages in one call.

import { registerAfpTranslation } from '@afp-design-system/core';

registerAfpTranslations({
  fr: { 'afp-badge.aria-label': 'Badge de statut' },
  es: { 'afp-badge.aria-label': 'Insignia de estado' }
});

Unregister translation #

unregisterAfpTranslation(code: string) #

Removes the translation dictionary for a language.

import { unregisterAfpTranslation } from '@afp-design-system/core';

unregisterAfpTranslation('fr');

Default Translations #

These translations are included by default. You can override them at any time by registering your own dictionaries.

Alert Close Avatar Avatar Group Badge Breadcrumb Breadcrumb Item Button Group Checkbox Checkbox Group Color Picker Copy Button Date Picker File Upload Input Option Password Validator Pin Input Progress Bar Progress Ring Radio Radio Card Radio Group Select Slider Stepper Table Tag Textarea Timeline Timeline Item All
Keyende
alert-close.aria-label Close alert Benachrichtigung schließen
Keyende
avatar.aria-label Avatar Avatar
avatar.img.alt Avatar Avatar
Keyende
avatar-group.aria-label Avatar group Avatar-Gruppe
avatar-group.count-text %s more avatars are hidden. %s weitere Avatare sind ausgeblendet.
Keyende
badge.aria-label Status badge Statusabzeichen
Keyende
breadcrumb.aria-label Breadcrumb navigation Breadcrumb-Navigation
breadcrumb.dropdown-label Hidden breadcrumb items Versteckte Breadcrumb-Elemente
breadcrumb.ellipsis-label Show hidden breadcrumb items Versteckte Breadcrumb-Elemente anzeigen
Keyende
breadcrumb-item.current-page Current page Aktuelle Seite
Keyende
button-group.aria-label Button group Button-Gruppe
Keyende
checkbox.aria-label Checkbox Checkbox
Keyende
checkbox-group.aria-label Checkbox group Checkbox-Gruppe
Keyende
color-picker.aria-label Choose color Farbe auswählen
Keyende
copy-button.aria-label Copy text Text kopieren
copy-button.success Copied successfully Erfolgreich kopiert
Keyende
date-picker.month.april April April
date-picker.month.august August August
date-picker.month.december December Dezember
date-picker.month.february February Februar
date-picker.month.january January Januar
date-picker.month.july July Juli
date-picker.month.june June Juni
date-picker.month.march March März
date-picker.month.may May Mai
date-picker.month.november November November
date-picker.month.october October Oktober
date-picker.month.september September September
date-picker.weekday.fri Friday Freitag
date-picker.weekday.mon Monday Montag
date-picker.weekday.sat Saturday Samstag
date-picker.weekday.sun Sunday Sonntag
date-picker.weekday.thu Thursday Donnerstag
date-picker.weekday.tue Tuesday Dienstag
date-picker.weekday.wed Wednesday Mittwoch
Keyende
file-upload.remove-file.aria-label Remove file Datei entfernen
file-upload.retry-upload-file.aria-label Retry upload file Datei erneut hochladen
Keyende
input.clear-button.aria-label Clear input Eingabe löschen
input.password-toggle.hide Hide password Passwort ausblenden
input.password-toggle.show Show password Passwort anzeigen
Keyende
option.close-button.aria-label Remove selection Auswahl entfernen
Keyende
password-validator.rule.fulfilled fulfilled erfüllt
password-validator.rule.unfulfilled not fulfilled nicht erfüllt
password-validator.rules.aria-label Password requirements Passwortanforderungen
Keyende
pin-input.digit Digit %s of %s Ziffer %s von %s
Keyende
progress-bar.aria-label Progress bar Fortschrittsanzeige
Keyende
progress-ring.aria-label Progress ring Fortschrittsring
Keyende
radio.aria-label Radio Radio
Keyende
radio-card.aria-label Radio card Radio-Karte
Keyende
radio-group.aria-label Radio group Radio-Gruppe
Keyende
select.clear-button.aria-label Clear selection Auswahl löschen
select.search-field.aria-label Search options Optionen durchsuchen
select.search-field.placeholder Search... Suchen...
Keyende
slider.aria-label Slider Schieberegler
Keyende
stepper.aria-label Stepper Stepper
Keyende
table.pagination.page Page %s of %s Seite %s von %s
table.pagination.selected %s selected %s ausgewählt
table.pagination.total-items %s item(s) %s insgesamt
Keyende
tag.close.aria-label Close tag Tag schließen
Keyende
textarea.clear-button.aria-label Clear textarea Textbereich löschen
Keyende
timeline.aria-label Timeline Zeitleiste
Keyende
timeline-item.aria-label Timeline item Zeitleiste Eintrag
Keyende
avatar.aria-labelAvatarAvatar
avatar.img.altAvatarAvatar
avatar-group.aria-labelAvatar groupAvatar-Gruppe
avatar-group.count-text%s more avatars are hidden.%s weitere Avatare sind ausgeblendet.
checkbox.aria-labelCheckboxCheckbox
checkbox-group.aria-labelCheckbox groupCheckbox-Gruppe
button-group.aria-labelButton groupButton-Gruppe
badge.aria-labelStatus badgeStatusabzeichen
tag.close.aria-labelClose tagTag schließen
progress-bar.aria-labelProgress barFortschrittsanzeige
progress-ring.aria-labelProgress ringFortschrittsring
alert-close.aria-labelClose alertBenachrichtigung schließen
radio.aria-labelRadioRadio
radio-card.aria-labelRadio cardRadio-Karte
radio-group.aria-labelRadio groupRadio-Gruppe
input.password-toggle.hideHide passwordPasswort ausblenden
input.password-toggle.showShow passwordPasswort anzeigen
input.clear-button.aria-labelClear inputEingabe löschen
textarea.clear-button.aria-labelClear textareaTextbereich löschen
select.clear-button.aria-labelClear selectionAuswahl löschen
select.search-field.placeholderSearch...Suchen...
select.search-field.aria-labelSearch optionsOptionen durchsuchen
option.close-button.aria-labelRemove selectionAuswahl entfernen
copy-button.aria-labelCopy textText kopieren
copy-button.successCopied successfullyErfolgreich kopiert
date-picker.weekday.sunSundaySonntag
date-picker.weekday.monMondayMontag
date-picker.weekday.tueTuesdayDienstag
date-picker.weekday.wedWednesdayMittwoch
date-picker.weekday.thuThursdayDonnerstag
date-picker.weekday.friFridayFreitag
date-picker.weekday.satSaturdaySamstag
date-picker.month.januaryJanuaryJanuar
date-picker.month.februaryFebruaryFebruar
date-picker.month.marchMarchMärz
date-picker.month.aprilAprilApril
date-picker.month.mayMayMai
date-picker.month.juneJuneJuni
date-picker.month.julyJulyJuli
date-picker.month.augustAugustAugust
date-picker.month.septemberSeptemberSeptember
date-picker.month.octoberOctoberOktober
date-picker.month.novemberNovemberNovember
date-picker.month.decemberDecemberDezember
color-picker.aria-labelChoose colorFarbe auswählen
file-upload.remove-file.aria-labelRemove fileDatei entfernen
file-upload.retry-upload-file.aria-labelRetry upload fileDatei erneut hochladen
slider.aria-labelSliderSchieberegler
breadcrumb.aria-labelBreadcrumb navigationBreadcrumb-Navigation
breadcrumb.ellipsis-labelShow hidden breadcrumb itemsVersteckte Breadcrumb-Elemente anzeigen
breadcrumb.dropdown-labelHidden breadcrumb itemsVersteckte Breadcrumb-Elemente
breadcrumb-item.current-pageCurrent pageAktuelle Seite
password-validator.rules.aria-labelPassword requirementsPasswortanforderungen
password-validator.rule.fulfilledfulfillederfüllt
password-validator.rule.unfulfillednot fulfillednicht erfüllt
timeline.aria-labelTimelineZeitleiste
timeline-item.aria-labelTimeline itemZeitleiste Eintrag
pin-input.digitDigit %s of %sZiffer %s von %s
stepper.aria-labelStepperStepper
table.pagination.total-items%s item(s)%s insgesamt
table.pagination.selected%s selected%s ausgewählt
table.pagination.pagePage %s of %sSeite %s von %s

Notes #

Share
Create a link with a predefined theme that is automatically applied when the generated link is opened. Default LBBW Presentation Mode
Abort Copy Link