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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:27:28+00:00 2026-06-09T04:27:28+00:00

I followed the whole documentation about text translation, but django doesn’t take my .mo

  • 0

I followed the whole documentation about text translation, but django doesn’t take my .mo file into account.

Some facts:

  • I created a conf/locale/ folder at the root of my project
  • django.po was generated successfully with django-admin.py makemessages -l fr
  • django.mo was generated successfully with django-admin.py compilemessages

So my folder structure is:

project/
  site/
  locale/
    fr/
      LC_MESSAGES/
        django.mo
        django.po
  • In settings.py, I have set LANGUAGE_CODE = 'fr'
  • My browser correctly sends Accept-Language:fr-FR,fr;
  • request.LANGUAGE_CODE shows fr from my views

But I get nothing translated… How to make django take these files into account ?


Edit

Adding /home/www/project/locale to settings.LOCALE_PATHS works. However, Django should find this path by itself, and I don’t like using absolute paths. What happens here ?

  • 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-09T04:27:30+00:00Added an answer on June 9, 2026 at 4:27 am

    LOCALE_PATHS

    Django looks for translation files in 3 locations by default:

    • LOCALE_PATHS/(language)/LC_MESSAGES/django.(po|mo)
    • $APPPATH/locale/(language)/LC_MESSAGES/django.(po|mo)
    • $PYTHONPATH/django/conf/locale/(language)/LC_MESSAGES/django.(po|mo)

    LOCALE_PATHS only need to be used if your translation files aren’t in your app directories or on the PYTHON_PATH.

    An example of LOCALE_PATHS in settings.py

    LOCALE_PATHS = (
        '/home/www/project/conf/locale', # replace with correct path here
    )
    

    MIDDLEWARE_CLASSES

    Add django.middleware.locale.LocaleMiddleware to MIDDLEWARE_CLASSES in settings.py

    LANGUAGES

    LANGUAGES = (
        ('fr', 'Français'),
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Followed this question about delayed_job and monit Its working on my development machine. But
I followed some tips in this guide: JTable with horizontal scrollbar but still having
I followed the instructions on source.android.com to build the Android framework, but when I
I followed this tutorial . But whenever I try to log in with my
I followed this link to gzip my php driven website It's working fine but
I followed this tutorial to implement facebook into my application. All I want is
Below i have shared my code in detail. I read documentation and everything about
I was reading the Wikipedia article on virtual inheritance. I followed the whole article
I have followed scott's gu tutorial here I uploaded the whole database to my
I have followed this to add the functionality to upload files, but I have

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.