Angular Modernizer
    Preparing search index...
    • Translation key usages in the templates and code of a project. Spec files are skipped.

      • Templates through inspectTemplate: translate pipe and directive, i18n="@@id", and the static prefixes of dynamic keys.
      • Code: calls on a TranslateService (instant, get, stream, getStreamOnTranslationChange) or TranslocoService (translate, selectTranslate). The key argument may be an array; each element counts. Keys in variables, constants, ternaries and helper returns are resolved with traceStringLiterals; 'A.' + x and `A.${x}` give a prefix (or full keys when x resolves to literals).

      A usage whose key has no static start is reported as a dynamic usage without prefix.

      Parameters

      • project: Project

        Project whose templates and program files are scanned.

      • options: I18nUsageOptions = {}

        Pipe and directive names, preloaded templates and template options.

      Returns I18nUsageScan

      Static usages, dynamic usages and the number of templates scanned.

      const scan = collectI18nUsages(project);
      // scan.usages[0] -> { key: 'ERRORS.NO_ACCESS', file: '/src/app/x.component.html', line: 3, source: 'pipe' }