npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ngx-i18nsupport/tooling

v8.0.3

Published

Schematics to add the tooling to be used with the Angular 2 i18n workflow

Downloads

12,718

Readme

Build Status Dependency Status devDependency Status npm

@ngx-i18nsupport/tooling

Schematics and architect builders for adding @ngx-i18nsupport to your projects.

Installation

After creation of an angular workspace (via ng new ..) you can add this package to your workspace using

ng add @ngx-i18nsupport/tooling

This will add the needed rpm packages and will configure usage of the tooling too. For further details have a look at the following chapter describing the schematics.

Schematics Usage

Add the tooling to your workspace (ng-add)

After creation of an angular workspace (via ng new ..) you can add this package to your workspace

ng add @ngx-i18nsupport/tooling

This adds the required packages and configures everything for the default language en, format XLIFF 1.2, no configured other languages.

There are some command line parameters available:

  • --project add the tooling to a specific project in your workspace
  • --languages the languages to be used (a comma separated list like en,de,ru)
  • --i18nLocale set the locale used in your templates (default is first language or en)
  • --i18nFormat the format to be used (xlf, xlf2 or xmb)

For example you can use the following

ng add @ngx-i18nsupport/tooling --project=myproject --i18nFormat=xlf2 --languages=en,de,ru

Add a new language (addLanguage)

In an already configured project you can add one or more additional languages by using

ng generate @ngx-i18nsupport/tooling:addLanguage de

There are some command line parameters available:

  • --project a specific project in your workspace
  • --language the language to be added
  • --languages the languages to be added (a comma separated list like de,ru).

Only --languages or --language can be used, not both.

For example you can use the following

ng generate @ngx-i18nsupport/tooling:addLanguage --project=myproject --languages=de,ru

This will add de and ru as additional languages.

Builders

Beginning with version 1.1.0 the tooling package contains an Angular Architect Builder (see for example the nice overview Builders demystified) that can replace the xliffmerge command line tool.

Old style calling xliffmerge after running ng xi18n via script in package.json:

{// DEPRECATED USAGE in package.json
..  "scripts": {
    [...]
    "extract-i18n": "ng xi18n <project> --output-path i18n --i18n-locale de && xliffmerge --profile xliffmerge.json de en"
  }
..
}

New style using the builder:

{// package.json
..  "scripts": {
    [...]
    "extract-i18n": "ng xi18n <project> --output-path src/i18n --i18n-locale de && ng run <project>>:xliffmerge"
  }
..
}

The builder and its configuration is configured in the angular.json workspace file:

{// angular.json
  "projects": {
    "<project>": {
      "architect": {
        ..
        "xliffmerge": {
           "builder": "@ngx-i18nsupport/tooling:xliffmerge",
           "options": {
             // profile used by xliffmerge
             "profile": "xliffmerge.json"
           }
        },

As an alternative to referencing the profile you can directly specify all allowed options of xliffmerge:

{// angular.json
  "projects": {
    "<project>": {
      "architect": {
        ..
        "xliffmerge": {
           "builder": "@ngx-i18nsupport/tooling:xliffmerge",
           "options": {
             // direct options
             "xliffmergeOptions": {
               "srcDir": "src/i18n",
               "languages": ["en", "de"],
                ..
             }
           }
        },

ng-update

Beginning with version 1.1.0 the tooling package contains an ng-update-Schematics. You can update from version 1.0 to 1.1 using ng update

ng update @ngx-i18nsupport/tooling

This will update the old xliffmerge commandline usage with the new builder.