PDA

View Full Version : menus with non-english language



aegis
31st March 2007, 19:33
hi, i wanted to create a menu with options written in greek so i wrote something like this::




anAction= new QAction("Επεξεργασία", this);

or

anAction= new QAction("Greek words...", this);



but when i tried to run the program the menu had rubbish....

how can i fix this problem?

jpn
31st March 2007, 19:52
Start with reading article Internationalization with Qt (http://doc.trolltech.com/4.2/i18n.html). ;)

The preferred way is to do:

anAction= new QAction(tr("Greek words..."), this);
and do the actual translation with the internationalization tools provided with Qt.

aegis
31st March 2007, 20:20
ok i could do this,but doesn't evolve alot of extra work for someone that doesn't want to translate his application simply write it from the beginning into another language....

wysota
31st March 2007, 20:35
Then this someone should use a proper encoding, set a codec or use proper QString methods that take input in the used encoding.

jpn
31st March 2007, 20:51
I have a feeling that using exotic letters might also cause problems for some compilers.

wysota
31st March 2007, 20:54
Not speaking of two or more people modifying the same file and forgetting to use the same encoding... Lots of problems :) Qt is quite liberal here, for example gettext forbids using message keys in encodings different than latin1.