experius / Magento-2-Module-Experius-MissingTranslations

Collect missing translations in specified folder or the entire Magento 2 Root
Open Software License 3.0
52 stars 13 forks source link

Removed JS-Translation.json updating mechanism #23

Closed florisschreuder closed 2 years ago

florisschreuder commented 3 years ago

Hi,

Currently, the JS-Translation.json file (which Magento uses on the frontend as a 'dictionary' to translate Javascript strings) is updated when: saving a translation or when the CRON runs to update the missing translations (by default every 24 hours).

However, the script updating the JS-Translation.json file does not 'know' which translations are specifically Javascript and which are 'standard'. So it updates the JS-Translation.json file with every translation of that locale available. This increases the size of the JS-Translation.json from around 10kb (Gzipped, so around 30-40kb on server) to around 300kb (Gzipped, so around 1 megabyte on server). This has a negative influence on the pagespeed of the shop, since the 300kb has to be downloaded and travelled through each time a Javascript files wants to execute.

In this PR is:

florisschreuder commented 3 years ago

@borisvankatwijk & @lewisvoncken