config/src/talenra-base.config.ts
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 { TalenraBaseConfig } from '@talenra/components/config';See ITalenraBaseConfig See TalenraBaseTranslatePipe See provideTalenraBaseConfig
Methods |
|
| Public getTranslation | ||||||||
getTranslation(key: TalenraBaseTranslationKey)
|
||||||||
|
Returns a reactive signal for the specified translation key. The signal automatically updates when translations are changed.
Parameters :
Returns :
Signal<string>
A signal containing the translated string value |
| Public setConfig | ||||||||
setConfig(config: ITalenraBaseConfig)
|
||||||||
|
Updates the configuration with translations and other settings.
Parameters :
Returns :
void
|
| Public setTranslation | ||||||||
setTranslation(value: Partial<TalenraBaseTranslationDictionary>)
|
||||||||
|
Updates the translation dictionary with partial values. Existing translations are preserved unless explicitly overridden.
Parameters :
Returns :
void
|