-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Interpolate strings without a translated value #347
Comments
I thought about using the If
|
It makes sense, I'll add it to the todo list (or you can do a PR!) |
Which do you prefer? 1. Support interpolation in MissingTranslationHandler only 2. Support interpolation for keys always |
Pull request opened: https://github.com/ocombe/ng2-translate/pull/348/files |
Adding comment to make the search easier for people in finding a working result: Though i would expect this to be default behaviour, this works for us:
using litterally the code from @biesbjerg in a seperate file
|
@SamanthaAdrichem, using |
@Halfist it was on v9. I will check it for you tomorrow between 9 and 11 CEST and let you know |
@Halfist we're on version 11.0.1 and still somewhat literally use the code above (only a different file name for the handler) HTML
HTML plurals
Typescript
If you use the greetings syntax you probably need to fix some code in the InterpolatedMissingTranslationHandler |
I'm submitting a ... (check one with "x")
Current behavior
I'm trying to mimic Gettext behavior:
This is the default behavior in ng2-translate, so far so good.
Where I'm running into trouble is when I have a string without a translation, that needs interpolation. The string isn't interpolated which makes sense if you use made-up keys like
LOGGED_IN_USER
etc, since you wouldn't need that to be interpolated, but in my case I do.Do you think that is something this lib could support?
EDIT: Example
If no translation is available for this message, it will output:
Instead of what I want:
(I'm using the new custom
TranslateParser
to allow me to interpolate{value}
in my strings)The text was updated successfully, but these errors were encountered: