Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Translation - Model Data
I have QML Application. Using ListView. Model is in C++. Data to the model is filled from DB. I would like to publish the app in different languages.
How can I translate the model data to different languages ? Any ideas ?
shaan7 last edited by
What kind of data does the model contain? If it is always going to be from a fixed pool of possible data, you can manually register the strings using
Otherwise, you might consider using an online translation API and doing the translations on the fly from the model (return the English data first, and then once your API call is successful, emit
Thanks @shaan7 for the reply. It is not fixed set of data. So we kept QT_TRANSLATE_NOOP out our scope. Data keeps changing everybody 15 days. Data is pushed to DB & app fetches the data from DB & starts working. We have written our own modules to some translation. I was looking at alternative ways as well.
You have everything in your database, you should also store all translations there un use a setting to determine which one the user wants for the application, then it's a matter of requesting the data for the right language.
@SGaist thanks for reply. This is what we are doing as of now. Just wanted to check whether we have any other option.