AngularJS directive and filter for localization with precompiled messageformat files
1 person uses it
Author: 6647414? trustner
Submitted by: 847947? mhannig


Lightweight AngularJS module for localizaion with messageformat files.

The module provides a (html enabled) directive and a filter for localization.

Both use precompiled messageformat translations. For more information about messageformat see


The module comes with both: a directive and a filter.


This module provides the tr-i18n directive. The directive extracts the message id from the content of the element:

Scope variables can be bound by providing them with the tr-i18n attribute:

The parsed hash will be applied to the i18n-function provided by the compiled messageformat source.

Variables are escaped. However, the translated message may contain html markup.


The filter may be used with or without additional params. Params are automatically updated by angular.

Like in every filter, markup is escaped. If you need html consider using the tr-i18n or ng-bind-html directives.

comments powered by Disqus
This page was last updated over 4 years ago.