Issue resolved. A big thank you to "praszyk" for the solution.
I am facing an issue with Angular Translate while using Search Filter. When the language is set to English, the list items are searchable in English as expected. However, when the language is set to Bangla, the items are still only searchable in English and not in Bangla. Is there a workaround for this?
View
<ion-list>
<ion-item>
<label class="item item-input">
<i class="icon ion-search placeholder-icon"></i>
<input type="text" ng-model="input.filterUser" placeholder="Search">
</label>
</ion-item>
<ion-item class="item-avatar" ng-repeat="user in groups | filter:input.filterUser">
<img src="{{user.avatar}}">
<h2>{{user.name | translate}}</h2>
<p>{{user.fullname}}
{{user.email}}</p>
</ion-item>
</ion-list>
Controller
.controller('CreditCtrl', function($scope, $ionicConfig, $translate) {
$scope.input = {};
$scope.groups = [
{
index: 1,
index_start_at: 56,
name: "Bnd_Nilgiri",
surname: "Hayes",
fullname: "Grace Beatty",
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5731253639343e24173b3e213e393024233839793224">[email protected]</a>",
bool: false,
avatar: "img/ionic.png"
},
{
index: 2,
index_start_at: 57,
name: "Bnd_Nilachal",
surname: "Shayes",
fullname: "Srace Beatty",
email: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="84f7ecf1f2ebc4e8edf2edeae3f7f0ebeaaae1f7">[email protected]</a>",
bool: false,
avatar: "img/ionic.png"
}
];
angular.forEach($scope.groups, function(user, index){
$translate(user.name, {user: user}).then(function(translated){
$scope.groups[index].name = translated;
});
});
})
Translation Provider
.config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider, $translateProvider) {
$translateProvider.translations('en', {
Bnd_Nilgiri : 'Nilgiri Tourspot',
Bnd_Nilachal : 'Nilachal Tourspot',
Bnd_Bogalake : 'Bogalake Tourspot',
});
$translateProvider.translations('de', {
// Bandarban Tour Spots
Bnd_Nilgiri : 'নিলগিরি ট্যুর স্পট',
Bnd_Nilachal : 'নিলাচল ট্যুর স্পট',
Bnd_Bogalake : 'বগালেক ট্যুর স্পট',
});
$translateProvider.preferredLanguage('en');