LogoLogo
❤️ SponserMore
  • 🚀Getting Started
    • Installation
    • Angular Compatibility
    • Config Options
  • 💡Core Concepts
    • Translation in the Template
    • Signals
    • Translation API
    • Language API
  • 🧠Advanced Topics
    • 🦥Lazy Load
      • Scope Configuration
      • Inline Loaders
    • The Transpiler
    • SSR Support
    • Unit Testing
    • Hack the Library
  • 🧪Sandbox & Examples
  • ⚙️Additional Functionality
    • Loading Template
    • Key Referencing
    • Utility Functions
    • Comments for Translators
    • Multiple Languages Simultaneously
  • 📦Migration Guides
    • Migrate from ngx-translate
    • Migrate from Angular's i18n
  • 🔧Tools
    • Keys Manager (TKM)
      • Keys Extractor
      • Keys Detective
      • Options
      • Debugging
      • Using with Nx 🐋
    • Validator
    • Optimize
    • Scoped Library Extractor
  • 🔌Plugins
    • Message Format
    • Persist Translations
    • Persist Lang
    • Preload Langs
    • Locale l10n
    • Community Plugins
  • 🧰Schematics
    • :ng-add
    • :scope
    • :join
    • :split
  • 🍳Recipies
    • Prefetch User Language
    • Using Xliff
    • Generate Locale Files using Google Translate
  • 📚Blog Posts
    • Transloco Team Posts
      • Transloco Goes Functional: A Guide to Transloco's Functional Transpiler
    • From the Community
  • ❓FAQs
Powered by GitBook

@ 2025 Transloco

On this page
  • Command
  • Features
  • Options
  • Usage Example

Was this helpful?

  1. Schematics

: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
pnpm add @jsverse/transloco
nx g @jsverse/transloco:ng-add

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
PreviousSchematicsNext:scope

Last updated 5 months ago

Was this helpful?

🧰