Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-l10n

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-l10n

An Angular library to translate messages, dates and numbers

  • 4.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.1K
decreased by-2.12%
Maintainers
1
Weekly downloads
 
Created
Source

Angular localization

Build Status npm version npm npm

An Angular library to translate messages, dates and numbers

This library is for localization of Angular v5 apps written in TypeScript, ES6 or ES5. It allows, in addition to translation, to localize numbers and dates of your app, adding language code, country code, currency code, timezone and optionally script code, numbering system and calendar, through Internationalization API. It also implements the validation of numbers by locales.

Sample app built with Angular CLI & Material, and its source code.

Get the changelog by releases.

Angular localization features

  • A module to translate texts & a module to translate texts, dates & numbers
  • A module for validation by locales (numbers)
  • Direct & Asynchronous loading of translation data
  • Available providers for Asynchronous loading:
    • Static (json files)
    • WebAPI (json format)
    • Fallback
    • Custom
  • Caching of the http requests
  • Composed languages (e.g. languageCode-countryCode)
  • Language, Default locale & Currency through ISO codes
  • Timezone through IANA time zone
  • Cookies, Session & Local Storage, or custom storage (e.g. for using with Ionic Storage) available for storing the ISO codes
  • Intl API to localize dates & numbers
  • Pure pipes & Directives to get the translation
  • Decorators or class inheritance for the ISO codes used by the pure pipes
  • Html tags in translations
  • Parameters in translations
  • Composed keys in translations (nested objects)
  • Directives can dynamically change parameters and expressions values as the pipes
  • Directives can translate also attributes
  • Directives work also with complex UI components, like Material or Ionic
  • Methods to translate in component class
  • Custom translation handler for translated values
  • Support for lazy loading
  • Collator for sorting and filtering a list by locales

Angular i18n solutions

FeatureAngular Officialngx-translate External libraryangular-l10n External library
MessagesHtml attributes, message IDsdirectives, impure pipesdirectives, pure pipes
File formatsXLIFF, XMB/XTBJSONJSON
No bootstrap (when language changes)not yetyesyes
Getting the translation in component classnot yetyesyes
Numberspure pipes using CLDR-directives & pure pipes via Intl API
Datespure pipes using CLDR-directives & pure pipes via Intl API
Validation--numbers validation via Intl API

Installing

You can add angular-l10n to your project using npm:

npm install angular-l10n --save 

To install a pre-release package:

npm install --save angular-l10n@next

Loading

Using SystemJS configuration
System.config({
    map: {
        'angular-l10n': 'node_modules/angular-l10n/bundles/angular-l10n.umd.js'
    }
});
Angular CLI

No need to set up anything, just import it in your code.

Rollup or webpack

No need to set up anything, just import it in your code.

Plain JavaScript

If you build apps in Angular using ES5, you can include the umd bundle in your index.html:

<script src="node_modules/angular-l10n/bundles/angular-l10n.umd.js"></script>

and use global ng.l10n namespace.

AoT compilation, Server Side Rendering & strict

This library is compatible with AoT compilation & Server Side Rendering. It also supports the strict TypeScript compiler option.

Usage

Contributing

License

MIT

Keywords

FAQs

Package last updated on 16 Feb 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc