Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9131337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:07:33+00:00 2026-06-17T08:07:33+00:00

In Qlinguist, I translated ui and some corresponding warning messages, generated qm file, and

  • 0

In Qlinguist, I translated ui and some corresponding warning messages, generated qm file, and loaded it, but in the result it only can translate the ui, but not those warning messages. My code is like this:

void MainWindow::translate()
{
     QTranslator translator;
     translator.load ( "Test.qm", "D:\\" );
     qApp->installTranslator ( &translator );
     retranslateUi ( this );
}

MainWindow::MainWindow ( QWidget *parent ) : QMainWindow ( parent )
{
    setupUi(this);
    translate();
    ...
}

One of my warning messages is in this form:

QMessageBox::warning( this, QMessageBox::tr("ERROR"), QMessageBox::tr("Invalid IP adress") );

This string can be load by lupdate, and I translated it in its qm file, but still cannot see its translation after running. Here I asked about it, but I have to open this new question in order to solve it with someone’s help. Can someone help me on this? Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:07:33+00:00Added an answer on June 17, 2026 at 8:07 am

    Creating the translator on the stack, it will be deleted right away at the end of translate().
    Try to create it on the heap instead so it lives on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If we wrap strings in tr() we can use the linguist to translate qt
The only tool I can find so far is https://github.com/github/linguist I am sure this
Detecting the MIME type of a file with PHP is trivial - just use
I am trying to use a Turkish translation file for my Qt project. I
I've been trying to install PyQt 4.7 on Vista, but I am getting an
The Qt Linguist can be used to load different images depending on the language
I am a linguist in charge of a C program, so please excuse me
I'd like to know if a tool like ANTLR would be appropiate for parsing
There are two forms of the QObject::tr() function I have been using for translating
I am working on Ubuntu 9.10 aka Karmic Kola and latest version of gcc,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.