angular.module('myApp', ['pascalprecht.translate'], ['$translateProvider', function ($translateProvider) {
// register translation table
$translateProvider.translations({
'HEADLINE_TEXT':'Hey Guys, this is a headline!',
'SOME_TEXT': 'A text anywhere in the app.'
});
}]);
angular.module('myApp').controller('Ctrl', ['$translate', '$scope', function ($translate, $scope) {
$translate('HEADLINE_TEXT').then(function(translations) {
console.log('loooo');
$scope.translatedText = translations[0];
});
}]);
<!doctype html>
<html ng-app="myApp" >
<head>
<meta charset="utf-8">
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
<script src="https://rawgithub.com/angular/bower-angular-cookies/master/angular-cookies.min.js"></script>
<script src="https://rawgithub.com/PascalPrecht/bower-angular-translate/master/angular-translate.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="Ctrl">
{{translatedText}}
</body>
</html>
/* Put your css in here */