File

config/src/talenra-base.config.ts

Description

Service managing translations and configuration for TalenraBase components. Provides reactive translation management using Angular signals.

Example :
import { TalenraBaseConfig } from '@talenra/components/config';

constructor(private talenraBaseConfig: TalenraBaseConfig) {}

ngOnInit() {
  // Get a reactive translation signal
  const cancelText = this.talenraBaseConfig.getTranslation('talenra.ui.base.button.cancel');
  console.log(cancelText()); // Outputs the translated text

  // Update translations at runtime
  this.talenraBaseConfig.setTranslation({
    'talenra.ui.base.button.cancel': 'Abbrechen'
  });
}

Import

Example :
import { TalenraBaseConfig } from '@talenra/components/config';

See ITalenraBaseConfig See TalenraBaseTranslatePipe See provideTalenraBaseConfig

Index

Methods

Methods

Public getTranslation
getTranslation(key: TalenraBaseTranslationKey)

Returns a reactive signal for the specified translation key. The signal automatically updates when translations are changed.

Parameters :
Name Type Optional Description
key TalenraBaseTranslationKey No
  • The translation key to retrieve
Returns : Signal<string>

A signal containing the translated string value

Public setConfig
setConfig(config: ITalenraBaseConfig)

Updates the configuration with translations and other settings.

Parameters :
Name Type Optional Description
config ITalenraBaseConfig No
  • The configuration object containing translations
Returns : void
Public setTranslation
setTranslation(value: Partial<TalenraBaseTranslationDictionary>)

Updates the translation dictionary with partial values. Existing translations are preserved unless explicitly overridden.

Parameters :
Name Type Optional Description
value Partial<TalenraBaseTranslationDictionary> No
  • Partial translation dictionary to merge with existing translations
Returns : void

results matching ""

    No results matching ""