owncloud / web

:dragon_face: Next generation frontend for ownCloud Infinite Scale
https://owncloud.dev/clients/web/
GNU Affero General Public License v3.0
444 stars 157 forks source link

Prevent loading all languages for all apps on initial page load #11035

Open JammingBen opened 5 months ago

JammingBen commented 5 months ago

Since we've introduced so many languages, the initial page loading times have gone down quite a lot. This happens due to the fact that we're loading all available languages for all apps during the initial load.

The goal of this issue is to prevent that and to just load the current language initially. Other languages are then being loaded on language change.

AlexAndBear commented 5 months ago

We need to split the translations.json into separate json files (e.g. de.json, ru.json etc.) https://jshmrtn.github.io/vue3-gettext/extraction.html This can happen via

    splitJson: false, // create separate json files for each locale. If used, jsonPath must end with a directory, not a file

set to true

dschmidt commented 5 months ago

Could possibly be implemented in multiple iterations as well... 1) do not merge and register everything all at once 2) really load on demand (async, so probably more complicated)

JammingBen commented 5 months ago

Okay so https://github.com/owncloud/web/pull/11040 prevents merging and registering all app languages on page load.

Splitting the languages into multiple files and loading them dynamically is not easy though. The splitting itself can be done without too much effort, but then we would need to implement some architecture so that translations can be dynamically loaded per app. So each app would need to provide a way to load translations for a given language on demand.

We don't have anything in that regard yet, and to be honest, I'm not sure if it's worth the effort currently.