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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:54:06+00:00 2026-05-30T16:54:06+00:00

In a Python application that uses gettext to provide support for internationalization, I would

  • 0

In a Python application that uses gettext to provide support for internationalization, I would like to change the path of the *.mo message catalogs to po/language.mo instead of the default localedir/language/LC_MESSAGES/domain.mo, as I would like to use Launchpad’s translation interface, which requires this naming scheme (at least as far as I understood [1]).

However, after reading the module documentation, I can’t seem to find a way to do this without monkey-patching the gettext module. Is there an ‘official’ way to do it?

[1] https://help.launchpad.net/Translations/YourProject/Exports


edit:
Thinking about it for a while, changing the path is not actually necessary for Launchpad-integration, as it only cares about the *.po files, not the compiled *.mo files.
My question still remains, though, as it would be nice if the application messed around with system directories as little as possible (especially considering that it’s a multi-platform app that runs on *nix, Windows and OS X).

  • 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-30T16:54:07+00:00Added an answer on May 30, 2026 at 4:54 pm

    I asked the same question for PHP, but the answer lies in the underlying gettext api. It’s not possible to change the path for catalogs.

    The directory structure is fixed by gettext.

    Because many different languages for many different packages have to be stored we need some way to add these information to file message catalog files. The way usually used in Unix environments is have this encoding in the file name. This is also done here. The directory name given in bindtextdomains second argument (or the default directory), followed by the name of the locale, the locale category, and the domain name are concatenated:

    dir_name/locale/LC_category/domain_name.mo

    See: PHP Gettext: how to change the default MO path after setting the path of the domain?

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

Sidebar

Related Questions

I would like to use Python to script an application that advertises itself as
I would like to build an application that uses Genetic Programming to figure out
I'm developing an application that uses webservices in python, both sides (server and client)
I am writing a Python/Django web application that uses OAuth (for the TwitterAPI, not
I am going to write an application that uses QT4 (with C++ or python
I'm building an application, that uses the Django templating engine / language to compile
I am developing a library and an application that uses the library in Python
I have an application that uses Flash for the GUI and Python for the
I have a python program that I would like to present as a simple
I'm writing a Python application that takes a command as an argument, for example:

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.