Nominate our 2022 Qt Champions!

Translations from SQL DB string?

  • Hey everyone,

    I'm working on an application with a variety of warning messages and errors that will appear on the front-end. I now have so many of these errors that I want to add the information strings about them (Title, message, actions to fix the error) to an SQL database table.

    How can I ensure that these strings will still be translatable by the application? Possibly by translating the literal strings on the C++ side at run time and then put them in the DB? Or is there a better way?

  • Lifetime Qt Champion


    You should rather store the original error message in the database and to the translation when showing the database content.