README

Description

This module solves some major problems with Magento2 translation system.

First of all it solves the problem of cached JS-Translation files:
Magento uses a cacheable json file for translations on forms.

These translations are stored in browser application cache:

On the one hand this cache follows the idea to push translations to client only a few pageloads -
on the other hand this behavior can produce difficulties for development.
The system uses mage-translation-file-version to determine the need for refreshing the cache.

If you want to change a translation in a js-active form in magento2
sometimes you have to:

Delete your browser cache

Delete your browser application storage

Flush the fullpage cache of M2

Flush the block / translation cache of M2

This process is acceptable if you just want to change one single translation,
and your are aware of all these steps. Otherwise you have to debug all these steps

just looking for the one step you have missed out to change another translation.

Secondly - although you have managed to go through all your steps to translate your magento2
store to another locale - you have to search for each translation key.

Third - the structure of Magento2 language packages is a real disadvantage:
A language pack does only contain a unordered list of translations in a csv.

This csv is really useful for agency translations and customizations of bought modules by external devs,
cause its only one file - but there is a catch:

If you have to define module scoped translations, for example for two translations with the same key,
but different translations its impossible.

Language packages that contain a entire dictionary in one directory.
You can distribute this language package as a standalone component (similar to modules and themes). Interestingly, it violates Magento’s modularity principles on purpose; that is, so that a system integrator can translations variations provided by extensions.

But what to do, if i need both: module structured translations AND one language pack for each locale?

Features

Debug cookie

This module enables the frontend-developer to set a cookie, which:

disables the cache in client web browser, the translation json file is generated every load