Skip to content
This repository has been archived by the owner on Jul 11, 2018. It is now read-only.

Suggestion: Update ng2-translate to support directives #25

Closed
abennouna opened this issue Dec 23, 2016 · 5 comments
Closed

Suggestion: Update ng2-translate to support directives #25

abennouna opened this issue Dec 23, 2016 · 5 comments

Comments

@abennouna
Copy link
Contributor

Version 4.1.0 adds directive support, and version 5.0.0 listens to translation changes as well when using directives.

@abennouna
Copy link
Contributor Author

Just for the record, that allows writing in the template this:
<ion-label translate>SETTINGS_OPTION1</ion-label>

instead of this:
<ion-label>{{ 'SETTINGS_OPTION1' | translate }}</ion-label>

Please that there's an open bug, which prevents using of this directive syntax:
<ion-label [translate]="'SETTINGS_OPTION1'"></ion-label>

@AndreasGassmann
Copy link

AndreasGassmann commented Dec 25, 2016

I personally still prefer using
<ion-label>{{ 'SETTINGS_OPTION1' | translate }}</ion-label>
because it is clear which part gets translated and you can add non-translatable text beside it.

@abennouna
Copy link
Contributor Author

ok but my point is that with the updated version, you can use either way

@abennouna abennouna changed the title Update ng2-translate Suggestion: Update ng2-translate to support directives Dec 26, 2016
@wbhob
Copy link

wbhob commented Jan 4, 2017

Both should work, and you're welcome to change it, but using the directive can be tricky for new users, for whom this is designed.

However, you are welcome to make a fork using the directive, and reference it on your blog/README of this repo. It is unlikely that they will pull it into the master branch, but you're welcome to make your own version. 😄

Please close this issue.

@abennouna
Copy link
Contributor Author

Who said this repo is for new users? If this is the case, the README should state it clearly.

Also, directive vs template interpolation is a matter of preference, but the sole dependency of the Super Starter should be update nevertheless, unless something prevents it?

@abennouna abennouna reopened this Jan 6, 2017
mlynch added a commit that referenced this issue Jan 12, 2017
Update ng2-translate version (fixes #25)
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

3 participants