I have some troubles...
I declare an array of string in a global object like that:
greeting_strings[0] = QT_TRANSLATE_NOOP("Global, "France");
greeting_strings[1] = QT_TRANSLATE_NOOP("Global, "Energy");
greeting_strings[2] = QT_TRANSLATE_NOOP("Global, "Caps");
greeting_strings[3] = QT_TRANSLATE_NOOP("Global, "Switch");
};
GeneralStruct::GeneralStruct(QWidget *parent):QWidget(parent){
greeting_strings[0] = QT_TRANSLATE_NOOP("Global, "France");
greeting_strings[1] = QT_TRANSLATE_NOOP("Global, "Energy");
greeting_strings[2] = QT_TRANSLATE_NOOP("Global, "Caps");
greeting_strings[3] = QT_TRANSLATE_NOOP("Global, "Switch");
};
To copy to clipboard, switch view to plain text mode
and than i place in another object the translated texts in that way:
for (i=0; i<Number_Of_Boxes; i++)
boxes
[i
].
Text = QCoreApplication::translate("Global", generalStructObject
->greeting_strings
[i
]);
for (i=0; i<Number_Of_Boxes; i++)
boxes[i].Text = QCoreApplication::translate("Global", generalStructObject->greeting_strings[i]);
To copy to clipboard, switch view to plain text mode
It doesn't work..
I don't understand why...?
How should i use the thing with context? i have to do it cause i use different objects with the same tr() translations..
Bookmarks