i18n in your AngularJS apps
Checkout the demos and help out making things better. You can start by reading the docs. If you like the module and use it in your projects, make it public on ngmodules!
There's also a mailinglist for questions and discussions.
- translate filter
- translate directive
- translate service
- multi-lang support
- asynchronous/lazy loading support
Attention: Since we're currently working on a specification for Reusable Angular Components, this project will have some breaking changes once the spec is called final.
Install module via Bower:
$ bower install angular-translate
Inject angular-translate
module as a dependency into your app:
var app = angular.module('myApp', ['pascalprecht.translate']);
Teach $translateProvider
translations:
app.config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations({
'TITLE': 'Hello',
'FOO': 'This is a paragraph',
});
}]);
Translate your app:
<h1>{{ 'TITLE' | translate }}</h1>
<p>{{ 'FOO' | translate }}</p>
To learn what else is possible, read the full documentation.
There are some pretty cool extensions you probably find interesting:
- Storage: $translateCookieStorage
- Storage: $translateLocalStorage
- Loader: $translateUrlLoader
- Loader: $translateStaticFilesLoader
Special thanks are going to the following devs who put a lot of love into this module:
- Jan Philipp - @knalli
- James Andres - @jamesandres
- Andy Joslin - @ajoslin
- @DWand