Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Migrate to v9

Transloco v9 ships an ng update migration that applies most of the breaking changes for you.

ng update @jsverse/transloco
nx migrate @jsverse/transloco

v9 is currently in alpha and published under the next tag. Install it with @jsverse/transloco@next.


What the migration does

Change
Automated?

Renames the removed translocoRead input to translocoPrefix, and the read microsyntax key to prefix

Yes

Adds provideGlobalTranslateFn() where the standalone translate() / translateObject() functions are used

Yes

Angular and rxjs peer dependency floors

Declared

Node.js >=22 for the CLI packages, and the chokidar bump

Reported

Keys Manager version line and its Angular / TypeScript floors

Manual


translocoRead is removed

The translocoRead input was deprecated in v8 and is gone in v9. Use translocoPrefix instead. In the structural form, the read microsyntax key becomes prefix:

Before
<ng-container *transloco="let t; read: 'dashboard'">
  {{ t('title') }}
</ng-container>
After
<ng-container *transloco="let t; prefix: 'dashboard'">
  {{ t('title') }}
</ng-container>

The migration rewrites both standalone templates and inline template strings in your components. Two cases it will not rewrite silently:

  • A template that doesn't parse. It is logged by path and skipped — such a template is already broken, so there is nothing to migrate in it. Rename it by hand.

  • An element that sets both translocoPrefix and translocoRead, where the prefix is an expression or an interpolated value. v8 fell back to the read whenever that prefix evaluated to empty, and only the running app can decide whether it does. The read is dropped and the file is logged — check those by hand.


translate() and translateObject() need a provider

The standalone translate() and translateObject() functions are no longer wired up automatically. Add provideGlobalTranslateFn() to your root providers:

Without it, translate() returns '' and translateObject() returns [], and both warn in development mode. The migration adds the provider for you when it finds the functions imported from @jsverse/transloco — detection is anchored on the import rather than on call sites, so a local helper of your own named translate is never mistaken for the global one, and an import type is correctly ignored.


Dependency floors

Peer dependencies, per package:

Package
Requirement

Transloco, Locale, Messageformat

@angular/core >=20, rxjs ^6.5.3 || ^7.4.0

Persist Lang, Persist Translations, Preload Langs

@angular/core >=20

Keys Manager

@angular/compiler >=20, typescript >=5.8

The Angular floor is declared as a peer range and as a requirement on the migration itself, so ng update refuses to run before it touches anything if your workspace doesn't satisfy it.

Node.js >=22 is now required by the CLI packages: @jsverse/transloco-keys-manager, @jsverse/transloco-optimize, @jsverse/transloco-scoped-libs, @jsverse/transloco-utils and @jsverse/transloco-validator. Node has no equivalent enforcement mechanism, so the migration reads your running version and warns if it is older.

Transloco Scoped Libs also bumped chokidar from v3 to v5, which is ESM-only.


Keys Manager

@jsverse/transloco-keys-manager moved into the main jsverse/transloco monorepo and joined the shared version line, so it jumps straight from 8.1.1 to 9.0.0. Nothing in its CLI or configuration changed — only the version number and the dependency floors above.

Last updated

Was this helpful?