[Qt-interest] Translation doesn't work

Alexandre Beraud aberaud at infflux.com
Fri Apr 17 13:44:08 CEST 2009


Hi,

Take a look at this:
http://doc.trolltech.com/4.4/qtglobal.html#QT_TRANSLATE_NOOP
I hope it helps.

Regards,

Alex


Sebastian Schöbinger a écrit :
> hi
>
> I have 2 problems with the translation in my program.
>
> First I defined in a global source file a StringList with languages and
> language infos.
>
> I defined it like this:
>
> languages << tr("Arabic") + ";sa;ar"
>
>                     << tr("Chinese") + ";cn;zh;"
>
>                     << tr("Croatian") + ";hr;hr;";
>
>
> after that I added them into a comboBox, but it was still english
> (instead of german), but everything else was german.
>
>
> QStringList languageList = globals::languageList();
>
> for (int i = 0; i < languageList.size();++i) {
>
> QStringList tempList = languageList[i].split(";");
>
> m_ui->firstLanguageBox->addItem(QIcon(":/flags/" + tempList[1]),
> QString("%1 (%2)").arg(tempList[0],tempList[2]));
>
>
> My second problem is nearly the same, but that is in the toolbar.
>
> QAction *action;
>
> QMenu *menu;
>
> ::writerDockAction = new QAction( this);
>
> ::writerDockAction->setText( tr("Writer"));
>
> ::writerDockAction->setCheckable(true);
>
> ::writerDockAction->setIcon( QIcon("://writer"));
>
> connect(::writerDockAction, SIGNAL(triggered(bool)), this,
> SLOT(toggleWriterDock(bool)));
>
> ui->mainToolBar->addAction(::writerDockAction);
>
>
> here is the same problem, everything else is translated, but not the toolbar
>
>
> Sebastian
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>   


-- 
BERAUD Alexandre
Ingénieur Développement

Infflux - Informatique & Flux
Tel: 01 49 57 92 00 - Fax : 01 49 57 92 01
Mail: aberaud at infflux.com
Visitez notre site :  www.infflux.com





More information about the Qt-interest-old mailing list