New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ng-localizer

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-localizer

A picker for find and create translate json files

latest
Source
npmnpm
Version
1.3.1
Version published
Maintainers
1
Created
Source

ng-localizer

The picker for search and create/edit translate json files.

Installation

Using npm:

$ npm install --dev ng-localizer

Add script to package.json:

"scripts": {
  "ng-localizer": "ng-localizer \"DIRECTORY_OR_FILE_SEARCH_KEYS\""
}

Using

Run

$ npm run ng-localizer

Use flag --full for search keys in whole project. Without it will search in only git change project Use flag --preserve-keys for preserve keys in project. Without it will delete unused keys

Config

You can customize autocreating config file in project's root (ng-localizer.config.json):

{
  "FILE_TYPES"   : ["ts", "html"],
  "LANGUAGES"    : ["ru", "en"],
  "KEY_REGEX"    : "'([aA-zZ0-9._\\-]*)' \\| translate|\\.instant\\('([aA-zZ0-9._\\-]*)'\\)|__\\('([aA-zZ0-9._\\-]*)'\\)",
  "PATH_JSON"    : "[aA-zZ0-9\\-_@]*\\/i18n\\/([aA-zZ0-9\\-_@]*)\\.",
  "CORE_MODULE_REGEX" : "\\.module.ts$",
  "ALLOW_CREATE" : true
}
  • FILE_TYPES - file types for search
  • LANGUAGES - for every key will generate file language
  • KEY_REGEX - default regular expressions for searching keys:
    • ([aA-zZ0-9._\\-]*)' \\| translate -> 'something.key' | translate
    • .instant\\('([aA-zZ0-9._\\-]*)'\\) -> '.instant('something.key')
    • __\\('([aA-zZ0-9._\\-]*)'\\) -> '__('something.key')
  • PATH_JSON - path for localization json files
  • CORE_MODULE_REGEX - regexp for find core modules
  • ALLOW_CREATE - allow create not exist files

Keywords

localization

FAQs

Package last updated on 22 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts