Search Posts

Category: angular-translate

Translating displayName values can not dynamic change in ng-grid

When i click the header menu to change language, The header text does not change after grid is rendered. var app = angular.module(‘app’, [‘ngTouch’, ‘ui.grid’, ‘pascalprecht.translate’]); app.controller(‘MainCtrl’, [‘$scope’, ‘i18nService’, ‘$http’, ‘$translate’, function ($scope, i18nService, $http, $translate) { $scope.langs = i18nService.getAllLangs(); $scope.lang = ‘nl’; $scope.gridOptions = { columnDefs: [ { displayName: ‘NAME’, field: ‘name’, headerCellFilter: ‘translate’ }, { displayName: ‘GENDER’, field: ‘gender’, headerCellFilter: ‘translate’ }, { displayName: ‘COMPANY’, field: ‘company’, headerCellFilter: ‘translate’, enableFiltering: false } ] […]

using messageformat with angular-translate

I’ve got a rails 4.1/angular 1.x app that I’ve got angular-translate-rails gem happily running on. I’m wanting to integrate pluralisation as per angular-translate-interpolation-messageformat and I’m not entirely sure I’m doing this right! I’ve got messageformat.js v0.1.7 and angular-translate-interpolation-messageformat.js loaded (I got them from this this plunkr ) I’ve got Māori language currently switched on (mi-std) and I’m getting the error Plural Function not found for locale: mi-std. I’m aware that mi-std isn’t the correct locale […]

ng-bind with AngularJS translate interpolation

I need to render characters such as < and >, which may be included in a user’s first or last name. I’m using angular translate to render the name, passing the first and last name as values. However, if the first or last name contains < the value will not be displayed. I think I need to use something like ng-bind=”translation_key | translate | values” but this is incorrect. How can I use ng-bind with […]

Passing function with the innerHTML in ng-class

I’m trying to create an ng-class clause in AngularJS that evaluates the length of the contents and assigns a class accordingly, the problem is that the text is retrieved using the angular-translate service, so when trying to pass the variable in the ng-class, it is still undefined. Here’s what I’ve tried so far <div ng-class=”{‘title-long-text’: $controller.isTextTooLong(common.title), ‘title’: !$controller.isTextTooLong(common.title)}” translate>common.title</div> the JS this.isTextTooLong = function(text) { if (typeof text === ‘undefined’ || !text) { return; } […]

When change default language angular-translate does not update key translate in service

When i use angular-translate. By changing the default language in another language, the following code does not work $translate(‘HEADLINE’).then(function (headline) { $scope.headline = headline; }, function (translationId) { $scope.headline = translationId; }); But the code below works very well: <ANY>{{‘TRANSLATION_ID’ | translate}}</ANY> Someone knows how can I write the translated code I want to translate into the controller? Source: AngularJS

TemplateSyntaxError – Invalid filter: ‘translate’ [duplicate]

This question already has an answer here: AngularJS with Django – Conflicting template tags 13 answers In my angularJs application, with django backend, I’m using angular-translate to handle multilingual work. It is working fine for AngularJs (html and controller) files, but for login file, that is rendering as template from django, it is giving exception TemplateSyntaxError at /login Invalid filter: ‘translate’ Here is exception detail; This is html where I’m trying to use translate Username […]

How to do ahead-of-time (AOT) translation in AngularJS like in Angular 2+?

I have AngularJS version 1.5 and want to translate my web into several foreign languages. The translation will run on different domains and there will be no language change option (no countries flags etc.). There are many examples for AngularJS – but only for something like ng2 JIT (just-in-time): https://technpol.wordpress.com/2013/11/02/adding-translation-using-angular-translate-to-an-angularjs-app/ or https://angular-gettext.rocketeer.be/dev-guide/compile/ Translations are done in browser at runtime. But I want to something like ng2 AOT (ahead-of-time): https://angular.io/guide/aot-compiler#!#ahead-of-time-aot-vs-just-in-time-jit- … compile translations at build time […]

How to use properties files with $translateProvider

I want to use in my angular 1.5 code $translateProvider.useStaticFilesLoader({ prefix: ‘localization/’, suffix: ‘.properties’ }); rather than $translateProvider.useStaticFilesLoader({ prefix: ‘localization/’, suffix: ‘.json’ }); My properties files is expected to be favoriteFood=kun pao chicken favoriteVegetable=artichoke favoriteSoda=Dr Pepper Source: AngularJS

Resx file AngularJS parameters configuration

I am using AngularJS and angular-translate in order to translate my strings with Software named: Zeta Resource Editor. In order to fill in the string the missing words, I am using {{}} (double curly brackets). Example: Hello to you {{ userName }}. The ‘userName’ variable will change from user to user. I am using Zeta Resource Editor to translate my strings. Is there any way to prevent the software from translating the string inside the […]

Next Page »