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 277305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T01:03:30+00:00 2026-05-12T01:03:30+00:00

I have a application written in wxPython which I want to make multilingual. Our

  • 0

I have a application written in wxPython which I want to make multilingual.
Our options are

  1. using gettext http://docs.python.org/library/gettext.html
  2. seprating out all UI text to
    a messages.py file, and using it to
    translate text

I am very much inclined towards 2nd and I see no benefit in going gettext way,
using 2nd way i can have all my messages at one place not in code, so If i need to change a message, code need not be changed, in case of gettext i may have confusing msg-constants as I will be just wrapping the orginal msg instead of converting it to a constant in messages.py

basically instead of

wx.MessageBox(_("Hi stackoverflow!"))

I think

wx.MessageBox(messages.GREET_SO)

is better, so is there any advantage in gettext way and disadvantage 2nd way? and is there a 3rd way?

edit:
also gettext languages files seems to be too tied to code, and what happens if i want two messages same in english but different in french e.g. suppose french has more subtle translation for different scnerarios for english one is ok

experience:
I have already gone 2nd way, and i must say every application should try to extract UI text from code, it gives a chance to refactor, see where UI is creeping into model and where UI text can be improved, gettext in comparison is mechanic, doesn’t gives any input for coder, and i think would be more difficult to maintain.

and while creating a name for text e.g. PRINT_PROGRESS_MSG, gives a chance to see that at many places, same msg is being used slightly differently and can be merged into a single name, which later on will help when i need to change msg only once.

Conclusion: I am still not sure of any advantage to use gettext and am using my own messages file. but I have selected the answer which at least explained few points why gettext can be beneficial.
The final solution IMO is which takes the best from both ways i.e my own message identifier wrapped by gettext e.g

wx.MessageBox(_("GREET_SO"))
  • 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-12T01:03:30+00:00Added an answer on May 12, 2026 at 1:03 am

    Gettext is the way to go, in your example you can also use gettext to “avoid storing the translations in the code”:

    wx.MessageBox(messages.GREET_SO)
    

    might be the same with gettext as:

    wx.MessageBox(_("GREET_SO")) or wx.MessageBox(_("messages.GREET_SO"))
    

    Gettext is pretty much the standard for multilingual applications, and I’m pretty sure you’ll benefit from using it in the future. Example, you can use Poedit (or other similar app) to assign translations to your collaborators or contributors and later on flag one or several messages as not properly translated. Also if there are missing / extra entries poedit will warn you. Don’t fool yourself, gettext is the only proven reliable way to maintain translations.

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

Sidebar

Ask A Question

Stats

  • Questions 272k
  • Answers 272k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer XML differs from TEXT only logically: first, the input is… May 13, 2026 at 1:59 pm
  • Editorial Team
    Editorial Team added an answer For creating a template - NVU with NVU Joomla Template… May 13, 2026 at 1:59 pm
  • Editorial Team
    Editorial Team added an answer values() is a static method, you can't call it on… May 13, 2026 at 1:59 pm

Related Questions

I've written a setup.py script for py2exe, generated an executable for my python GUI
Developing a project of mine I realize I have a need for some level
I have a web application written in C# that consumes several internal web services.
I have a desktop application written in C#. It is trying to manage a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.