Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, December 2007
tr() is not working for me


Message 1 in thread

I am creating applications to create various calendar pages
( Shameless plug: <http://www.diyplanner.com/templates/dynamic/> --  
and all the source is there )
I live in the US

I am encountering problems with tr()

Specifically, in the app DIY_Two_Page_Year, I received email from a  
Netherlander, telling me that things were not translating properly

I am using the QDate::toString() method for all day and month names  
and that is working, but static text - like buttons and labels and  
such do not work.

They show up in English.

Example code snippets:

QPushButton *quit = new QPushButton ( tr ( "Quit" ), this ) ;

QString leftLabel = tr("Calendar Year ") ;

But it all shows up in English.
What did I miss ?
Do I need a translation file to get things like "Quit" to translate  
to the "local" language ?

--
 [ signature omitted ] 

Message 2 in thread

> But it all shows up in English.
> What did I miss ?
> Do I need a translation file to get things like "Quit" to translate
> to the "local" language ?

You hit your own nail on the head.

In the assistant hit the home button to get the first index page. 
Under "Core Features" is "Internationalisation".  Click that.

A

--
 [ signature omitted ] 

Message 3 in thread

Hello Dan,
use document for "internationalize" and do not forget to load the 
translation for qt itself, you'll find it in $QTDIR$/translations (QM + 
TS - files), if you do not load, all "standard dialogs" like QMessageBox 
are in english language.

Regards,
Peter

Dan White schrieb:
> I am creating applications to create various calendar pages
> ( Shameless plug: <http://www.diyplanner.com/templates/dynamic/> -- and 
> all the source is there )
> I live in the US
> 
> I am encountering problems with tr()
> 
> Specifically, in the app DIY_Two_Page_Year, I received email from a 
> Netherlander, telling me that things were not translating properly
> 
> I am using the QDate::toString() method for all day and month names and 
> that is working, but static text - like buttons and labels and such do 
> not work.
> 
> They show up in English.
> 
> Example code snippets:
> 
> QPushButton *quit = new QPushButton ( tr ( "Quit" ), this ) ;
> 
> QString leftLabel = tr("Calendar Year ") ;
> 
> But it all shows up in English.
> What did I miss ?
> Do I need a translation file to get things like "Quit" to translate to 
> the "local" language ?
> 
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ]