Translation of entity values


(Jorge Marques) #1

Hi,
Is there any way to have localised values for entities?


(Mario David) #2

Hi,

what do you mean by values of entities? Do you mean translation of attributes (e.g. Customer.orders = Orders / Bestellungen)?

Generally, the docs should give you a good starting point: https://doc.cuba-platform.com/manual-6.2/localization.html

Bye,
Mario


(Konstantin Krivopustov) #3

Probably this is about localizing values, not captions. Do I understand right that you want to store multiple values for a field and display one depending on the current user locale?


(Jorge Marques) #4

Hi Konstantin. That’s precisely it. I understand that the display part can be a bit domain specific, but having a some sort of component for inserting localised data for some of the attributes would be really cool.


(Konstantin Krivopustov) #5

Hi Jorge,
We’ve implemented such kind of text field in one of our products in the following way: the entity attribute stores a JSON that contains values in all required locales, and the text field chooses one depending on the current locale. The obvious drawback is that you cannot search by this attribute (at least by strict equality) using standard mechanisms.
We have the following preliminary thoughts of how to solve the problem in the platform:

  • add a special @Localizable annotation for attributes containing localizable values;
  • the annotation can also specify how to store the values - in a JSON or in separate attributes of the entity;
  • standard text fields will recognize the annotation and work with the value for the current locale;
  • the mechanism of getting the instance name (based on @NamePattern) should also recognize @Localizable.
    What do you think? In what part of your system do you need localizable attributes?

(Sebastian Helman) #6

Hi,

we would like to know what the status is regarding localizable values in CUBA Platform. It’s something we really need in our project and we would prefer a built-in solution for it.


(Konstantin Krivopustov) #7

Hi Sebastian,

You can track the progress using the linked issue. The roadmap for release 6.5 is already closed, so we are going to deal with this problem later this year.


(system) #8

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-8711


(Tom Monnier) #9

The linked ticket has priority major but seems this hasn’t been touched in over a year.

This is a very important requirement for us.

Any tips/guides or update on the roadmap?


Entity instances translation
(Rene) #10

Hi there! Are there any updates on the status of the feature?


Entity instances translation
(Ivan Doroshenko) #11

Any updates? :slightly_smiling_face: