I am writing an application which has content that can be added from external sources (through a set of JSON files). Therefore the content to be displayed is mostly unknown at comile time but will be curated (no random sources).
For the content that is known at compile time I can add translations by adding the corresponding tr()
guards or QT_TR_NOOPS
in the sources where the external content is parsed.
Is there a way to achieve the same for strings that are unknown at compile time? I could add the text for the several translations in the JSON file and write my own code the translation. However I would prefer to have all translations in a central file and use Qt translation code. I would then update the qm
file containing the translation together with the JSONs and restart the application.