Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Translate alert messages question? #1466

Closed
maikelsgit opened this issue Apr 19, 2016 · 1 comment
Closed

Translate alert messages question? #1466

maikelsgit opened this issue Apr 19, 2016 · 1 comment

Comments

@maikelsgit
Copy link

I know how to add translation like this in the html file:
<h2 translate>SETUP.WELCOME</h2>

But how can I add a translation to a confirm popup or alert popup in my controller.js

var alertPopup = $ionicPopup.alert({
   title: "Error", // how can I translate this line
   template: "Something is going wrong, try again later" // how can I translate this line
});         
alertPopup.then(function(res) {
   console.log('ok is pressed');
});

Thanks!

@tspaeth
Copy link
Member

tspaeth commented Apr 19, 2016

you could use the service with $translate or the filter - see the docs here: http://angular-translate.github.io/docs/#/guide/03_using-translate-service

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants