tolgee-js icon indicating copy to clipboard operation
tolgee-js copied to clipboard

Outdated way how to provide injection tokens in Angular & outdated documentation for Angular

Open Celtian opened this issue 4 months ago • 1 comments

Is your feature request related to a problem? Please describe.

You have already described only module based Angular aproach, which were abondonned by Angular team 2 years ago.

See your docs

Describe the solution you'd like

You should do something like this:

export const appConfig: ApplicationConfig = {
  providers: [
    provideTolgee({
      config: {
        cdnUrl: environment.tolgee.cdnUrl,
        defaultLang: DEFAULT_LANGUAGE,
        languages: LANGUAGE_OPTIONS,
        localStorageKey: 'tolgeeLang',
      },
      options: {
        apiUrl: environment.tolgee.apiUrl,
        apiKey: environment.tolgee.apiKey,
        availableLanguages: AVAILABLE_LANGUAGES,
        fallbackLanguage: DEFAULT_LANGUAGE,
        defaultLanguage: DEFAULT_LANGUAGE,
      },
    }),
};

or something like


provideTolgee({ /* config */ }, withDevTools(), withFormatSimple()),

Why? Because of the type-safety ...

Describe alternatives you've considered

None

Additional context

None

Celtian avatar Aug 05 '25 21:08 Celtian

Thank you for reporting this issue.

Moving this issue to https://github.com/tolgee/tolgee-js due to the Angular integration code being maintained in that repository.

Thank you for helping improve Tolgee's Angular integration! 🚀

dkrizan avatar Aug 06 '25 07:08 dkrizan