Skip to main content

TranslationService

The TranslationService service is used to optimize Translations before sending them to the client from the server to keep the transfer state as small as possible.

import { TranslationService, Inject } from '@archibald/server';

In order to use the TranslationService service, you need to inject it by using the Inject decorator function.

@Inject()
protected translationService: TranslationService;

optimizeMessages

This method iterates through the translation tree from the global store and removes unused ones.

const messages = this.translationService.optimizeMessages(PARAMETERS);

Parameters

NameTypeDescriptionDefault
messagesSet<string>An object with the project configuration.