ngTranslate
Simple multi language in an AngularJS application
This repo is for distribution on npm
only.
Install
You can install this package with npm
only.
npm
npm install ng-translate
Then add ngTranslate
as a dependency for your app:
angular;
Initialize ngTranslate on run of application
$translate;
Create folder in the root of your applicatie with name: languages
You will place your language files inside the language folder. File name format as follow: en_US.lang.json. An example file:
Using in your application
Change the language in the application
$translate;
Get current language name, name must be exists in the *.lang.json file
$translate;
Use translation as filter inside your template
{{ 'APP_TITLE' | translate }}