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

  • Home
  • SEARCH
  • 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 3439410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:18:25+00:00 2026-05-18T08:18:25+00:00

i am using pyqt and designer . i have translated all the strings in

  • 0

i am using pyqt and designer. i have translated all the strings in my app with self.tr() + pylupdate4 and lrelease

here is the snippet of code in my main():

app = QtGui.QApplication(sys.argv)
app.setApplicationName('Mental Calculation')

# initialize locale and load translation files if available
locale = QtCore.QLocale()
LOCALENAME = str(locale.system().name())
translator = QtCore.QTranslator()
translator.load("mentalcalculation_%s" % LOCALENAME)
app.installTranslator(translator)

I use a QDialogButtonBox in a QDialog with a QtGui.QDialogButtonBox.Cancel and a QtGui.QDialogButtonBox.Ok

and the strings in these buttons are not translated. because pylupdate4 does pick any string for them.

Have I missed a configuration step in my app so that they are translated ?
I don’t understand how the string for standard buttons of QDialogButtonBox are supposed to be translated and can’t found doc about that.

  • 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-05-18T08:18:25+00:00Added an answer on May 18, 2026 at 8:18 am

    Use the method below to set the buttons’ text:

    buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Ok"));
    buttonBox->button(QDialogButtonBox::Cancel)->setText(tr("Cancel"));
    

    then lupdate .ts file, open it with linguist and you’ll find the strings.

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

Sidebar

Related Questions

I'm using PyQt 4.4. It's best shown using some pictures. All nodes should have
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I am new to the world of PyQt.I am using PyQt designer for designing
Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I am new to PyQt and Qt Designer and I'm trying to create an
I'm having some trouble in using PyQt/SIP. I guess the SIP is compiled into
I'm trying to display a QLabel (without parent) at a fixed position using PyQt.
I'm new to QT. I'm using PyQT for GUI development in my project. I
I'm practicing PyQt and (Q)threads by making a simple Twitter client. I have two

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.