Add Translatable string to domain model - Mendix Forum

Add Translatable string to domain model

7

Mendix currently provides some support for multilingual apps, with the translations for enums, labels etc. However Mendix does not have any support for multilingual data in apps. The best way I've encountered so far is to work with a "Translatable"-object with a relation to a "Translation"-object which contains the value for each language and then inherit from the "Translatable"-object whenever you need some multilingual data.

However this soon becomes cumbersome, you start needing calculated attributes to display the correct data in many cases. And when you have many data that needs to be translated, your translations tables get really big, and as Mendix does not support multiple inheritance you're also limited in domain model design choices.

Now how cool would it be if Mendix would be able to take this away from the developer, and add out-of-the-box support for multilingual data? I was thinking along the lines of adding a "translatable-string" to the domain model, where Mendix would deal with storing the different translations in the database. Similar to Enumerations you could then have functions to retrieve/display the data. By default it could display the value in the users current language, but it should also be possible to retrieve values in different languages in microflows etc.

 

Domain model

 

Calculated attribute CurrentTranslation

asked
1 answers

great idea!

Created