-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Unable to use translation service programmatically #63
Comments
Hi @t0nyak, Your problem is that the translation files did not successfully load yet when you tried to use the From the docs: |
how to load the translation files before calling any method |
is this possible ? If not translate method should be removed |
@sysmat @gs-mhashir I recommended reading the docs. |
I'm submitting a...
Current behavior
Translation programmatically is not working at all.
Expected behavior
Being able to translate somehow in the component.
Minimal reproduction of the problem with instructions
translate()
method with the exact string to the value to be translated like this:this.service.translate('section.subsection.value')
No matter if I inject the service using
constructor(private service: TranslocoService) {}
or I directly importtranslate()
function. Both of them do nothing.I know the path to the value in the translation files is correct, since it works using the template approach.
By the way, I'm not providing a stackblitz demo since I've not been able even to reproduce the transloco-example in the stackblitz. Is the project and the demo still being supported?
Environment
The text was updated successfully, but these errors were encountered: