-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Get multiple strings with same parameter name #123
Comments
Good point, looks like a design flow :) |
Maybe we need two different methods, one for getting a single string and one for getting multiple strings. When getting multiple strings, we should pass an array of objects for parameters.
What do you think? |
Yes, that'd probably be a better idea |
Is it possible now? |
Any updates on this? Is this possible in any way now? This would be a really useful feature. |
bump. im too after this feature. my use case is
I want the first "LastDays" to be passed 7 and the second one passed "30", so my calendar input shows "Last 7 Days" and "Last 30 Days". The work around is to you have 2 separate translations, but it would be nice to just have the one and use a variable. |
I'm also interested in this feature. It seems like a design flaw that an array can be passed for the first argument, but the second has to be an object. I'd expect the interpolateParams to allow an array of interpolateParams, which applies to each key. My use case:
|
Hi,
translate.instant allows to pass an array of keys to get multiple strings at the same time. If the strings have the same parameter name, there is no way no pass a different value for each string.
This is a sample json:
{
"string1": "test {{name}}",
"string2": "test2 {{name}}"
}
let strings = translate.instant(['string1', 'string2'], { name: 'sample' });
Is there a way to pass a different value for name parameter to string1 and string2?
The text was updated successfully, but these errors were encountered: