About translation for "system attributes"

Hi Team,

In CUBA, the “system attributes” of entity like createdBy,createdTs belong to a base entity class,so providing translation for these attributes is simple,we just need to translate once.
But in Jmix, we have to tranlate again and agian for these attributes in different classes. For only one project, it’s not a serious problem, we can define a base class for all entities to resolve the problem .
But if we included many addons , we must translate these attributes for every addon .
Is there a better solution for it? Or am I missing something?

Regards,
Ray

Hi Ray,

Obviously, if the add-ons are under your control, you can create a base add-on and put your entity superclass together with the localization into it.

Otherwise, you could create a code generator in a running application, that would iterate through all entities of the application and write a message bundle contents for all “system” attributes. Then you could copy-paste it into the project’s messages.properties. Just an idea :slight_smile:

Regards,
Konstantin

Hi Konstantin,
Thanks for your reply.

Seems I did not missed something. :grinning: .
I think the second approach also is not graceful,it needs some manual operations that developers are hate . :sweat_smile:
Hope Jmix framework can provide a mechanism for that at some point . Maybe through providing a specific MessageSource in runtime or APT in development time.
Anyway ,it’s just a minor problem and I will find a solution.

Regards,
Ray