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 (). NgDoc ships complete translations in entry points of their own, such as 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
function provideNgDocTexts (texts: NgDocTextsOverrides []): Provider [];Returns
Parameters
| Name | Type | Description |
|---|---|---|
| texts | | 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 }“` },
});