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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@siemens/element-translate-ng

v48.6.0

Published

Element translation abstraction layer.

Readme

Element Translate

element-translate-ng is a translation abstraction layer. It can be used with

  • ngx-translate
  • Angular localize
  • Other frameworks in the future

See here for details how it works and how to use it.

Usage

Install the library as follows:

npm install --save @siemens/element-translate-ng

An important part of the library is the extraction of translatable keys as a TypeScript interface as well as extracting a JSON messages file with default translations. The extraction happens on compiled files. I.e. make sure to run the build first. Then, to run these extractions

npx update-translatable-keys

By default, this will pick of the configuration from a file element-translate.conf.json. To use a different config file, pass as the only argument to the command.

The config file looks like this

{
  "files": "dist/@simpl/**/fesm2022/**/*.mjs",
  "configs": [
    {
      "name": "element",
      "locationPrefix": "projects/element-ng",
      "keysFile": "projects/element-ng/translate/si-translatable-keys.interface.ts",
      "keysInterfaceName": "SiTranslatableKeys",
      "messagesFile": "dist/@siemens/element-ng/template-i18n.json"
    }
  ]
}
  • files is a glob pattern for defining the files to scan
  • configs is an array of configs. For mono-repos building multiple libraries, they can be separated into different configs. All keys are required:
    • name is a unique name
    • locationsPrefix defines the path prefix of the source files, important to distinguish between different libraries in a mono-repo
    • keysFile defines the path of the generated TypeScript interfaces file
    • keysInterfaceName defines the name of the TypeScript interface
    • messagesFile defines the path of the generated messages JSON file

Testing

Run npm run translate:test to perform the unit tests via Karma. You can set a seed for running the tests in a specific using an environment variable: SEED=71384 npm run translate:test

License

The following applies for code and documentation of the git repository, unless explicitly mentioned.

Copyright (c) Siemens 2016 - 2025

MIT, see LICENSE.md.