Base solution for your next web application
Open Closed

Localization question #3403


User avatar
0
robrechtbelien created

Hi,

I have a localization question: I've built an entity where tenant admins can create evaluation questions. Those questions are used elsewhere to be presented to the users and they need to reply to them. So a tenant admin can add questions just like he can add roles or users. Those questions are displayed to users with the possibility to select an answer.

What is the best way to localize them? If I use the retrieved questions and pass them in the L() function it's easy, and I can add the transaltions to the xml files. This way the entire localization is in simple xml files and easy to mange. The downside is that it's not possible for an admin to translate the questions.

The other possibility is to allow the admins to add translations to the questions in the entity itself. This is a little bit more work to set up and has the downside that when a new language is added we do not only need to translate the xml file but would also have to go in the the entity and add all translations manually.

Any ideas about the best approach?

Regards, Robrecht


1 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    hi,

    Using tranlation xml files is not suitable for this kind of development. Because translation files are purposed to localize UI texts not client entry data.

    I'd go like this, let's say you have Question entity. I'd create QuestionTranslations with columns (QuestionId, LanguageCode, Text) And you can allow admins to enter translations. (better way is integrating with google translate to help the admins for inspiring) When a new language comes, the problem is still there with the 2 approaches . Somebody must translate the old questions.