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

Global parameters / missing parameter handler #50

Open
revenz opened this issue Oct 28, 2019 · 3 comments
Open

Global parameters / missing parameter handler #50

revenz opened this issue Oct 28, 2019 · 3 comments

Comments

@revenz
Copy link

revenz commented Oct 28, 2019

I'm wanting to use global parameters in translation strings, things I don't have to pass in all the time. eg . {ProductName} etc, where any string can just use that and it will be translated.

Either some kinda of global parameters, or a missing parameter handler where I can set these, or a pre-translate event where i can alter the passed in parameters adding the global ones there.

Is there any current way to do this?

@lephyrus
Copy link
Owner

That's an interesting idea, sounds useful. There's currently no way to do this that I'm aware of.

@lemoinem
Copy link

We have the same issue.
The way we do it, is by using a custom loader and doing the replace when the translations are loaded.

Of course, that means we can't update the value of these parameters if they ever change during the lifetime of the app (unless the translations are reloaded).

@revenz
Copy link
Author

revenz commented Nov 28, 2019

I just ended up writing a wrapper class, in that wrapper class adding the common translation parameters to the parameters (or creating parameters if null), then call the translate service.
works well enough, and live translations as we need. just would be nice if this was baked in, because I could see it being useful.

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

3 participants