Estoy tratando de implemantar angular-translate
en mi página. Pero en el momento de solicitar el cambio de idioma me marca el siguiente error:
$translate.uses is not a function
app.js
var ole_no_ldap_validate=angular.module("ole_no_ldap_validate",['ngRoute','localization','pascalprecht.translate']);
ole_no_ldap_validate.config(function ($translateProvider){
$translateProvider.translations('es',{
'_save_': 'Lista de Tareas',
'_employeeName_': 'Nombre del Empleado',
'_employeeNumber_': 'Numero de empleado',
'_organization_': 'organizacion',
'_country_': 'pais'
});
$translateProvider.translations('en',{
'_save_': 'List',
'_employeeName_': 'Employee name',
'_employeeNumber_': 'Employee number',
'_organization_': 'Organization',
'_country_': 'Country'
});
$translateProvider.preferredLanguage('en');
});
Controller.js
ole_no_ldap_validate.controller("ole_no_ldap_validateController",['$scope', '$http','$translate',function($scope, $http, $translate) {
$scope.context = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2));
$scope.ChabgeLanguaje=function(idioma){
$translate.uses(idioma);
};
page.jsp
<button type="button" class="btn btn-default btn-sm" tabindex="5" ng-click="ChabgeLanguaje('es');">
<span class="ion-search"></span>
<span>ES</span>
</button>
<button type="button" class="btn btn-default btn-sm" tabindex="5" ng-click="ChabgeLanguaje('en');">
<span class="ion-search"></span>
<span>EN</span>
</button>