mikrocat
28th April 2016, 13:45
Hey,
I read various articles about this problems. But still didn't get how to figure it out.
A connected device is sending me different names like "temperature", "pressure". I want to translate this names depending on the selected language of the app. I have a list of all the names that can be send.
I thought about something writing all names in a .cpp and create a -.ts file but how do I tell that I want to translate all "temperature"-Strings on my ui?
QT_TRANSLATE_NOOP("Names", "temperature");
QString TempName;
for (int j = 7; j < response.size(); ++j){
TempName.append(response.at(j));
}
tempdata->setGroupName(QT_TR_NOOP(TempName));
I read various articles about this problems. But still didn't get how to figure it out.
A connected device is sending me different names like "temperature", "pressure". I want to translate this names depending on the selected language of the app. I have a list of all the names that can be send.
I thought about something writing all names in a .cpp and create a -.ts file but how do I tell that I want to translate all "temperature"-Strings on my ui?
QT_TRANSLATE_NOOP("Names", "temperature");
QString TempName;
for (int j = 7; j < response.size(); ++j){
TempName.append(response.at(j));
}
tempdata->setGroupName(QT_TR_NOOP(TempName));