An AngularJS module handling the l20n localization library.

Angular Core Dependency: 1.6.6

Module License: MIT

Added by: Sam Deering





Stars: 37

Watchers: 37

Forks: 8

Module Description

ng-l20n Build Status

An AngularJS module handling the l20n localization library.


Usage is simple - just use a data-l20n attribute with an l20n identificator (with a stock l20n you'd use data-l10n-id instead) so tutorials from still apply with this little change.

An example sandbox is included. You can freely use Angular expressions inside the attribute, they will be parsed for you before passing to l20n.


Locale is stored in localStorage. The localStorage key as well al the $rootScope property that stores the locale are customizable:

myApp.config(["l20nProvider", function(l20nProvider) {
  l20nProvider.localeStorageKey = 'myAppLocaleKey';    // default: 'locale'
  l20nProvider.localeProperty = 'myAppLocale';         // default: none

If the localeProperty is not specified, nothing will be saved to $rootScope.

Minification and linting

Minification and linting is supported via Grunt tasks. To obtain the minified file together with the sourcemap, first install a global grunt-cli package:

npm -g install grunt-cli

Then install local npm packages:

npm install

After performing these steps, invoking:


will lint & build the files; you can copy all 3 files (ng-l20n.js, ng-l20n.min.js, from the dist/ folder.


ng-l20n requires l20n.js in version 1.0 or newer.


The module is available under the MIT license (see MIT-LICENSE.txt for details).

Module stats last updated: 2017-11-13 16:00:04

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!