Sylius: [RFC] Decrease number of translation files by merging "flashes" into "messages"

Created on 21 Apr 2016  路  7Comments  路  Source: Sylius/Sylius

Currently, there are 1938 translations files in Sylius and paths to all of them are included in the compiled container. 268 of them (14%) are from flashes domain, which are usually made of only a few sentences.

Merging them into default messages one will be the first step for Sylius to consume less memory and perform less IO operations (especially in dev environment).

DX Enhancement RFC

All 7 comments

Good idea!

yes please!

Another way to decrease the number of files in sylius could be using annotations to handle validations and mapping information. This also represent (IMO) a improvement in the DX because you not need jump between files to modify one entity (Currently you need open the php file, the doctrine yml file and validation yml file).

@pamil not so bad idea ;)
@gperdomor The main reason to use validation/mapping yml files rather than annotation is decoupling php models/forms from its mapping/validation. So in fact using yml files are more developer-friendly, when doing some customizations ;) Nowadays we have many bright and shiny IDE's like PHPStorm, which allow as to move between different files smoothly and with no problems at all. Merging translation files is a different story, as it _de facto_ does not benefits noticeable to have them separated, but increase memory usage.

@gperdomor Annotation is mixing configuration with the code and coupling specific configuration to code. You can use a single class with 10 different configs, unless you use annotations. That's why I am not a fan. :/

@gperdomor the models are in the components which are raw php classes that can be used with any framework and storage. The worst thing we can do is to couple them to Symfony or ORM.

Btw. should we make a BC break in ResourceBundle's FlashHelper to use messages domain and hardcode it just as the flashes domain now? Or should we add an option to the constructor that configures the used domain? Or even make a configuration option below sylius_resource?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikemix picture mikemix  路  3Comments

xleliberty picture xleliberty  路  3Comments

crbelaus picture crbelaus  路  3Comments

loic425 picture loic425  路  3Comments

bnd170 picture bnd170  路  3Comments