Hi again!
Well, i did exactly what you said, but it still doesn't work and i'm starting to get crazy.
This is what i do:
1. I have a global class, which have this strings array initialize:
greeting_strings[0] = QT_TR_NOOP("France");
greeting_strings[1] = QT_TR_NOOP("Energy");
greeting_strings[2] = QT_TR_NOOP("Caps");
greeting_strings[3] = QT_TR_NOOP("Switch");
};
GeneralStruct::GeneralStruct(QWidget *parent):QWidget(parent){
greeting_strings[0] = QT_TR_NOOP("France");
greeting_strings[1] = QT_TR_NOOP("Energy");
greeting_strings[2] = QT_TR_NOOP("Caps");
greeting_strings[3] = QT_TR_NOOP("Switch");
};
To copy to clipboard, switch view to plain text mode
2.Now, in order to install the translator when necessary, i send from the main the QApplication pointer, and later install in it the translator:
app->installTranslator(NewTranlator);
app->installTranslator(NewTranlator);
To copy to clipboard, switch view to plain text mode
3. Then, I change the texts of the visible icons to the new language like this:
for (i=0; i<Number_Of_Boxes; i++)
boxes[i].Text = tr(generalStructObject->greeting_strings[i]);
for (i=0; i<Number_Of_Boxes; i++)
boxes[i].Text = tr(generalStructObject->greeting_strings[i]);
To copy to clipboard, switch view to plain text mode
The new word is exactly the same! it doesn't change at all!
What is the problem here? do i miss something?
Bookmarks