@devjb said in When using id based translations, how to show the engineering english text, if no translator has been installed:
the Qt framework itself, despite containing a lot of strings and thus matching the description
does not use the id based system at all.
I think that's one strong advantage of the "string based" translations schema that Qt proposes. Even with no translator loaded, or missing .qm files the application/library can still display some "meaningful" string, the one used to do the query for a translation.
Regarding "Engineering English", if you check the example in the same documentation you pointed to, you'll see that //% comment actually ends up as the "source" field in the .ts file, see:
Text {
id: backTxt;
//: The back of the object, not the front
//% "Back"
//~ Context Not related to back-stepping
text: qsTrId("id-back-not-front");
}
The example text-ID-based user interface text from above results in the following content in the .ts file:
<message id="id-back-not-front">
<source>Back</source>
<extracomment>The back of the object, not the front</extracomment>
<translation type="unfinished"></translation>
<extra-Context>Not related to back-stepping</extra-Context>
And very important, that whole example assumes that you'll go through the full cycle: lupdate (create .ts files), manual translation via Linguist, lrelease (create .qm files), app installing translator so the value of the source field (in this case //% "Back" will display as the translation.
I'd suggest that you use a plain-text-based approach for translation of your library. Qt framework itself is a long time example it works fine.
I'd only recommend going with text-ID-base approach if you already have such translations using such schema (i.e. existing translations shared by lots of applications)