You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Things work on pages, but do not work inside modals. It's as if the translate service is not available inside the modal. If, inside the modal, I re-initialize the translate service by running this.translate.use('fr'); then things work fine. The following code, for example, works fine.
import { TranslateService } from 'ng2-translate/ng2-translate';
@Component({
templateUrl: 'my-modal.html',
selector: 'my-modal',
})
export class MyModal {
constructor(
private translate: TranslateService
) {
var self = this;
this.translate.use('fr'); // Re-initializing the translate service inside a modal
// Here on translation works fine
}
}
Expected behavior:
I should not need to re-initialize the translate service inside my modal. I should only need to initialize it once inside app.component.ts.
Other information:
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
I'm using ng2-translate, with a set up exactly as described here: https://ionicframework.com/docs/v2/resources/ng2-translate/
Things work on pages, but do not work inside modals. It's as if the translate service is not available inside the modal. If, inside the modal, I re-initialize the translate service by running
this.translate.use('fr');
then things work fine. The following code, for example, works fine.Expected behavior:
I should not need to re-initialize the translate service inside my modal. I should only need to initialize it once inside app.component.ts.
Other information:
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Here are some relevant lines from my package.json
The text was updated successfully, but these errors were encountered: