Search Posts

Category: angular-translate

How to pass the results from a rendered directive as variable to angular-translate

I have a (rather complex) directive that can render amounts in a currency. It formats the currency based on the rules of that currency (e.g. if a currency has cents etc.) and formats the number and symbol based on the locale. I’d like to use the outcome of the directive as a variable in a translation. There is a plunker with a simplified setup here In short, what I’d want: Your balance: <strong currency data-amount=”-1337″ […]

ng-repeat an array json angular-translate

first of all im new in AngularJs. Please pardon my noobness. Im trying to create an exam site. The questions is stored in a JSON file. Below is the JSON data { “Question”: “1 + 1 = ?”, “AnswerList”: [ { “Id”: 1, “Answer”: “1” }, { “Id”: 2, “Answer”: “2” }, { “Id”: 3, “Answer”: “3” } ], “CorrectAnswer”: “1”, “Remarks”: “1 + 1 is 2.” }, { “Question”: “2 x 2 = ?”, […]

Angular-translate always using english

Hopefully someone here can help me figure out what is going on. I have an Angular 1.5.8 app, using angular-translate 2.15.2. I have language files set up for English and Japanese and can swap languages at runtime, but the default language on page load is always ‘en’. I’ve set my computer language to Japanese, but I can’t get my site to default to that language. Here is my translations config: ‘use strict’; (function() { angular.module(‘app’) […]

Angualr JS translate not working properly inside Visualforce page

I need to translate my html into different languages based on user preference. For that I am using Angular JS translate method. The example when I write inside notepad and saved as “.html” is working fine. But when I pasted the same code inside my Salesforce Visualforce page, its behaviour changes.ie. When I click on button”IT” to translate the content to “Italics” the contents are translating to Italics but within seconds the contents are again […]

AngularJS ES6 import angular-translate

I’m trying to import angular-translate in angularjs 1.5.3 project using ES6 when I try import angular-translate; it doesn’t import any thing from the angular translate module, I tried also import pascalprecht.translate from ‘angular-translate’; but that generates a syntax error as it doesn’t accept the . or – in the module name. did any one know the correct way to import angular-translate in my project. thank you in advance. Source: AngularJS

AngularJS translate parameterized string

Assume we receive some error messages such as maximum allowed item is X from a server where X is a variable number determined in server. We want to translate and show this given message in an angularjs client application. Is there any way to translate such that parameterized strings in AngularJS? For example one such as following: angular.module(‘saasdmPhoenixApp’).config( function($translateProvider) { $translateProvider.translations(‘xx’, { ‘maximum allowed item is %d’ : ‘translated string with %d as number’ } […]

Is it possible to store the translation table in localstorage with angular-translate for an offline use of my app?

I’m developing a multi-language app with Ionic and angular-translate. I get the translation table from a server with $translateProvider.useStaticFilesLoader. It works like a charm as long as the app has an internet connection. The problem is that the client could use the app offline and of course, when you launch the app without internet, it breaks cause translations are not available. Does anyone knows if it’s possible to store the translation table in localstorage (or […]