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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:15:14+00:00 2026-06-14T04:15:14+00:00

How to use locale directory from include package and locale directory in my own

  • 0

How to use locale directory from include package and locale directory in my own project.

My main function

settings = dict(settings)
settings.setdefault('jinja2.i18n.domain', 'mypackage1, mypackage2') #NOT WORK!!!

config.include("mypackage1")
config.add_jinja2_search_path(("mypackage1:templates",
                               "mypackage2:templates"))

config.add_translation_dirs("mypackage1:locale/",
                            "mypackage2:locale/")
config.add_jinja2_search_path(("mypackage1:templates",
                               "mypackage2:templates"))

return config.make_wsgi_app()
  • 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-14T04:15:15+00:00Added an answer on June 14, 2026 at 4:15 am

    You might have misunderstood what the context it. To quote the pyramid glossary :

    A string representing the “context” in which a translation was made.
    For example the word “java” might be translated differently if the
    translation domain is “programming-languages” than would be if the
    translation domain was “coffee”. A translation domain is represnted by
    a collection of .mo files within one or more translation directory
    directories.

    It’s not possible to cumulate contexts by setting it to something like ‘mypackage1, mypackage2’. What you need to do is make sure that all translation dirs have the same domain, set it in the configuration and call add_translation_dirs with the multiple dirs.

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

Sidebar

Related Questions

Is there a way to use numpy from a local directory without adding the
I currently develop an iOS app for a local business directory, and I use
In .Net when handling numbers with unspecified locale I use: return double.Parse(myStr, CultureInfo.InvariantCulture.NumberFormat); Whats
I would like my app by default use the phone locale for localization. But
I use cakePHP 2.0 and use the console tool to create one .../app/locale/default.pot .
I have started a new mvc project and clicked on project\properties\web - use local
In PHP I'm receiving a string from the user for a local file directory
I wish to use the Tomcat install/deploy tasks from catalina-ant.jar to deploy a webapp
I have django installed on my server with pymongo and mongoengine.My django project settings.py
According to this from the devise wiki I should be able to use a

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.