Skip to content
@ng-doc/app / Function

provideNgDocTexts

Changes the texts NgDoc shows to readers, for example to translate them. Pass the groups and texts to change; every other text keeps its English default (NG_DOC_DEFAULT_TEXTS). NgDoc ships complete translations in entry points of their own, such as NG_DOC_TEXTS_DE from @ng-doc/app/texts/de; pass one first and your changes after it.

Calls and arguments add up: in one injector they apply in order, so a later one wins for a text both set, and the providers of a child injector (a lazy route, for example) apply on top of the texts of its parent. The texts are read when a component is created, so they are fixed per injector: switch the language by reloading the application, not at run time.

DeclarationTypeScript

Returns

Provider[] -

The providers to add to the application, a route or a page.

Parameters

NameTypeDescription
texts
NgDocTextsOverrides[]

The texts to change, by group, in the order they apply.

Example usage

provideNgDocTexts(NG_DOC_TEXTS_DE, { search: { placeholder: 'Handbuch durchsuchen…' } });

provideNgDocTexts({
  search: { placeholder: 'Dokumentation durchsuchen…' },
  searchPalette: { noResults: ({ query }) => `Keine Ergebnisse für „${query}“` },
});
Symbol
Kind
Function
Scope
@ng-doc/app
Edit this page