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
Using own translations #8160
Comments
@sgiehl do you maybe know if it's already possible for a plugin to overwrite translation of another plugin? if not, we don't need to add this feature quite yet, but i was just wondering if it's already possible... |
Good question. IIRC it was not possible in the first version. But I'm not sure if that is still the same after Translation system was refactored. |
It would be nice to be able to. Background: What about my example code? Is there a way to overwrite the usage of other classes? |
Another way to overwrite especially this text can be another iframe url parameter like the cssfile parameter. This way every site can decide which text to use. What do you think of that? |
You could use dependency injection to override translators like this:
This way you can hardcode overrides. Note, though that this is not part of the public API. So we might break it in the future w/o warning. |
@christophlehmann you got the answer. Thanks @diosmosis |
Thanks to @diosmosis' nice trick, I wrote a small plugin that allows overwriting translations: It is really basic (only allows one language for now), but should be useful if one wants to edit one string in Matomo. |
Is there a way to use own translations overruling piwiks translations or is there a way to extend the translate function like
The text was updated successfully, but these errors were encountered: