@Findus23 opened this Issue on February 16th 2020 Member

Followup from #14954

I noticed that the whole GDPR overview page, the help on the GDPR Tools page and the whole GDPR tool is hardcoded in English.

To make it possible for everyone to use them, we should make them translatable.

@sgiehl commented on February 17th 2020 Member

created a PR for GDPR overview and opt out.

Regarding the GDPR Tools. That page is fully generated with angularjs components. That means if we make it translatable, we would need to put all the translations for it into the javascript translation array. As that would be quite a lot new translations in there, I was wondering if there might be a better solution we could implement, maybe like loading the needed translations on demand using JS. Or prerender the templates before serving them, so the most translations would be done serverside.

@tsteur @mattab @diosmosis Any thoughts on that?

@tsteur commented on February 17th 2020 Member

You mean like getPluginTranslations?plugins=PrivacyManager,CoreHome or how would we get the needed translations for this? Or you mean one request for all translations?

GDPR overview is already in the twig template? GDPR tools has some translations but also not crazy many. Maybe could still do it the normal way for now?

Pre-rendering is out of scope for now as this adds quite some complexity and potentially would need to upgrade angular for it etc. It's important to focus on the Matomo 4 milestone for now.

Maybe something to keep in mind for Matomo 5 or so? Not sure how much data we're talking about GZIPED. If I see this right this is maybe currently only around 30KB?

I reckon eventually it could be good to fetch translations through an ajax request with some good caching and not serve them on every page view but might make the UI bit funny if translations take too long to load.

It be for sure good to have, but reckon not much of a priority right now considering all the other things we have to do.

@sgiehl commented on February 17th 2020 Member

It's quite a lot new stuff in here: https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/PrivacyManager/angularjs/manage-gdpr/managegdpr.directive.html and https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/PrivacyManager/angularjs/anonymize-log-data/anonymize-log-data.directive.html

We could for sure simply add them to the javascript translations, but that way they would be loaded everywhere, but they would only be needed on that one page.

Implementing something like and API method getPluginTranslations might be a good way. Will have a quick look tomorrow if that is easy doable...

@tsteur commented on February 17th 2020 Member

@sgiehl Maybe create a new issue for this refactoring, and then it can be scheduled eventually. It's not a priority right now. Be good to focus on 3.13.3 and Matomo 4 first 👍

@diosmosis commented on February 17th 2020 Member

Can we store the translations in a JSON file like asset files are stored (in tmp and gzipped)? Then the user would only need to load it once in a while.

@tsteur commented on February 18th 2020 Member

I reckon something like this could work, would need to be generated per language though. The problem is that you can't really ensure that file exists in tmp so it would likely need to go through Matomo PHP. The good thing is this allows us to send proper cache headers. So far it's not yet really an urgent problem but could re-evaluate then as part of Matomo 5 to see how much data the translations are to see if it has become a problem 👍

@sgiehl commented on February 24th 2020 Member

Updated the PR above so all GDPR pages are now translatable. As discussed for now all translations will be in the javascript array...

This Issue was closed on February 25th 2020
Powered by GitHub Issue Mirror