Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate inside ng-if can cause duplicates with Angular 1.2 #18

Closed
rubenv opened this issue Nov 13, 2013 · 6 comments
Closed

Translate inside ng-if can cause duplicates with Angular 1.2 #18

rubenv opened this issue Nov 13, 2013 · 6 comments

Comments

@rubenv
Copy link
Owner

rubenv commented Nov 13, 2013

No description provided.

@rubenv
Copy link
Owner Author

rubenv commented Nov 15, 2013

This is not an angular-gettext bug, it's angular/angular.js#4852

@rfgamaral
Copy link

I just came across this... Quick question, it will not ever be possible to have translations inside ng-if or ng-switch directives?

@rubenv
Copy link
Owner Author

rubenv commented May 16, 2014

If anyone comes up with a fix, I'd love to have it. Haven't found a good
fix yet.

You can easily work around it by adding an extra div or span.
On May 16, 2014 6:53 PM, "Ricardo Amaral" notifications@github.com wrote:

I just came across this... Quick question, it will not ever be possible to
have translations inside ng-if or ng-switch directives?


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-43354096
.

@rfgamaral
Copy link

You mean extra div or span inside the ng-if? Cause I tried that and couldn't make it work :(

Maybe I did something wrong, will have to try again... That would be a work around that I wouldn't mind much.

@rubenv
Copy link
Owner Author

rubenv commented May 19, 2014

This should work:

<a ng-click="doSomething()" ng-if="showLink">
    <span translate>Do something!</span>
</a>

@rfgamaral
Copy link

Yeah, I forgot to mention that I had tested again and it worked. I might have done something wrong the first time I tried it.

Thanks, and sorry for the trouble.

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

No branches or pull requests

2 participants