-
Notifications
You must be signed in to change notification settings - Fork 277
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
Add possibility of translation via http://angular-translate.github.io/ #57
Comments
Could be related #3 I will make a PR shortly. Stay tuned. |
i18n is always good, but I don't really want to make toasts insecure. |
@artworkad would it be possible for you to inject the translation service or the resolved translations instead? so instead of: you have something like:
|
Hello, I am stuck any advices? |
I am closing this because it is a concrete use case I cannot merge on the library. If you want to use the filters for i18n, you can override the template (Use the version without tpls and create your own template, check the readme). |
Will go with a custom template, however would be great to re-visit this and add it as part of the functionality. Essential for multi language apps and hard coding the messages is not great even for single language apps. This could be a simple and extendable way to manage messages in one place. How about adding the ability to add a 'translate' config and let toastr know to use the translate filter? Those who have security concerns can leave it off and those who need it can enable at their own risk. 👍 |
It is still better to create another template for it. If I start adding opinions to the template, it will be a monster. On the other hand, that library for i18n is not the only one and even applying filters is not the only option for that concrete library. |
No worries. Took about 5 mins to set up the template and its working like a charm! |
You call toasts from within controllers, but this has a major downside: you have to hardcode the text for the toasts. If you provide a template that uses http://angular-translate.github.io/ a toast call would look like this:
in template:
and the angular translate module would determine the message for SAVED_KEY which is "Saved!".
The text was updated successfully, but these errors were encountered: