The Wayback Machine - https://web.archive.org/web/20190322175545/https://github.com/robisim74/angular-l10n
Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

An Angular library to translate messages, dates and numbers
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
docs Upgrade version Feb 10, 2019
src Refactor(L10nTranslationProvider) Feb 10, 2019
tests Fix(LocaleValidation): default values: #228 Jan 6, 2019
.gitignore Build: .gitignore Dec 4, 2017
.travis.yml
CONTRIBUTING.md Docs: switch to material & updating Nov 5, 2018
LICENSE
README.md Upgrade to v7.0.0 Dec 17, 2018
angular-l10n.ts Rename index.ts to package name Sep 12, 2017
build.js
karma.conf.js
license-banner.txt Build: upgrade to Angular v5 building process Oct 8, 2017
mkdocs.yml Update mkdocs.yml Dec 17, 2018
package-lock.json
package.json
public_api.ts Refactoring & upgrade to Angular v5 Aug 25, 2017
rollup.config.js Feat: Add Search decorator & json-ld component Dec 13, 2018
rollup.es.config.js
spec.bundle.js
tsconfig-build.json
tsconfig.json
tslint.json Feat: Add Logger Dec 1, 2018

README.md

Angular localization

Build Status npm version npm npm

An Angular library to translate messages, dates and numbers

This library is for localization of Angular v7 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
    • LocaleValidationModule for number validation by locales
    • LocaleSeoModule for SEO by locales
    • CollatorModule for sorting and filtering a list 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

Feature Angular Official ngx-translate External library angular-l10n External library
Messages Html attributes, message IDs directives, impure pipes directives, pure pipes
File formats XLIFF, XMB/XTB JSON JSON
No bootstrap (when language changes) not yet yes yes
Getting the translation in component class not yet yes yes
Numbers pure pipes using CLDR - directives & pure pipes via Intl API
Dates pure 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 v7

  • 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

You can’t perform that action at this time.