Socket
Socket
Sign inDemoInstall

angular-l10n

Package Overview
Dependencies
7
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-l10n


Version published
Maintainers
1
Install size
2.42 MB
Created

Readme

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 apps. 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

  • More modules to support tree shaking:
    • TranslationModule to translate texts
    • LocalizationModule to translate texts, dates & numbers
    • LocalizationExtraModule new features of Intl API like collator and relative time
    • LocaleValidationModule for number validation by locales
    • LocaleSeoModule for SEO by locales
    • LocaleInterceptorModule for setting the locale in Accept-Language header on outgoing requests
  • Direct loading of translation data (objects)
  • Asynchronous loading of translation data (JSON):
    • Static
    • WebAPI
    • Fallback
    • Custom
  • Caching of the http requests
  • Rollback on error
  • Composed languages: language[-script][-country]
  • 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 to get the translation
  • Directives to get the translation:
    • can dynamically change parameters and expressions values as the pipes
    • can translate also attributes
    • work also with complex UI components, like Material or Ionic
  • Parameters in translations
  • Composed keys in translations (nested objects)
  • Html tags in translations
  • Methods to get the translation and to format dates & numbers in component class
  • SEO by locales:
    • localized routing
    • translation of title and meta tags
    • translation of JSON-LD structured data
  • AoT compliant
  • Lazy loading compliant
  • Server Side Rendering compliant
  • strict TypeScript compiler option compliant

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 

Usage

  • Angular v8

  • Angular v7 (Angular l10n v7.2.0)

  • Angular v6 (Angular l10n v5.2.0)

  • Angular v5 (Angular l10n v4.2.0)

  • Angular v4 (Angular l10n v3.5.2)

  • Angular v2 (Angular l10n v2.0.11)

Contributing

License

MIT

Keywords

FAQs

Last updated on 23 Jul 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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc