:ng-add

Simplify the setup of Transloco in Angular projects with this schematic. It creates boilerplate translation files, configures the root module, and supports additional features like SSR and custom loaders.


Command

ng add @jsverse/transloco

Features

  • Generates translation files for specified languages.

  • Configures Transloco in the root module.

  • Optional SSR support.

  • Customizable translation loader and file paths.


Options

Option

Alias

Description

Type

Default

--langs

-

Specifies the languages for which translation files will be created.

string

en, es

--loader

--lo

Defines the loader used for fetching translation files.

string

Http

--ssr

-

Adds configurations required for projects using Server-Side Rendering (SSR).

boolean

false

--path

--p

Specifies the location for the generated translation files.

string

assets/i18n/

--project

-

Specifies the project where Transloco should be installed.

string

Project root directory name

--module

-

Defines the root module where TranslocoModule and related configurations should be imported.

string

app

Usage Example

ng add @jsverse/transloco --langs en,fr --loader Webpack --path src/i18n/ --project my-angular-app --module app.module.ts

Last updated

Was this helpful?