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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:12:48+00:00 2026-05-16T06:12:48+00:00

My question is regarding i18n in Python. From what I understand, it involves: Create

  • 0

My question is regarding i18n in Python. From what I understand, it involves:

  • Create a messages file per language (ONLY ONE?!).
  • in this file, each message will be of the format
    • English message here
    • Message en Francais ici (yea crappy french..)
  • then have this file compiled into another faster binary format
  • repeat for all other langs needed
  • in app code (Django) use the translate method with english (or default) language which will be translated correctly based on locale… tr('English message Here')

Probably I’m a bit off on the steps, but this seems to be the general sense right?

What I’m wondering is, is there a simpler way? I mean in the java webapp world, you set up message bundle files in the bundleName_locale.properties format. In each one you usually have a key to message relation like greeting = Hello World. You can have lots of different properties files for different sub sections of your site/app. All the locale files are hierarchical, and missing keys in a sub locale fall through to the parent etc. This is all done automatically by Java, no setup required.

Is there anything like this in the Django/Python world? Is this just insane to follow this route? Could I fake this using a module as a stand in for a java .properties file? Sorry for the long-winded question, and thanks for any input.

  • 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-16T06:12:49+00:00Added an answer on May 16, 2026 at 6:12 am

    While you could do this fairly simply, I would question why.

    As is:

    1. Django’s i18n is based around gettext, which has never given me any performance problems.
    2. You don’t have to create the message file, Django will do it for you.
    3. The messages files Django creates can be sent as a text file to just about anyone for translation.
      • I spent about 5 minutes explaining to someone how to use them, and a day later got back a fantastic translation of my entire site.
    4. Marking the strings in your code is very simple.
      • _("My String") is normal for .py files by using from django.utils.translation import ugettext as _.
      • {% trans "My String" %} in your templates. Again, quite simple.
      • Writing out bundle.getString("My String") seems like it would get old, quick.
    5. You can easily incorporate Django’s i18n into your JavaScript, if needed.
    6. There are web-based editors for the message files.
    7. You don’t have to define a string more than once, it conglomerates all instances into one token across your entire app.
      • How many times do you have to define “Save” in your Java properties files?
    8. Still in a nice, version-tracking friendly, text file.
    9. If you hack together a .properties-like way to define your strings, you’d still want to compile them so that you don’t have to parse the text file at execution time.

    Example of empty .po file:

    #: templates/inquiries/settings/new_field.html:12
    #: templates/inquiries/settings/new_form.html:4
    msgid "Save"
    msgstr ""
    

    Personally, I don’t see a reason to bother hacking together a replacement for a solution which already exists and works well.

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

Sidebar

Related Questions

simple question regarding property value inheritance in UserControls. If i create a UserControl, it
another newbie-question regarding rails and bootstrap. I am using something like this: <div class=tabbable
One question regarding whether the following code should yield a compiler warning or not
simple question regarding HQL(Hibernate query language) so i have user class , that can
Quick question regarding Automapper. I'm mapping data from an incoming web service, where datetimes
Quick question regarding this Socket(String host, int port) If I use these arguments in
I have a question regarding file reading and I am getting frustrated over it
I have a question regarding parsing data from Wikipedia for my Android app. I
I have a question regarding calling methods from different threads. Well I am using
Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the

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.