Search code examples
djangodjango-rosetta

How does the exclude work in Django-Rosetta


I use both aullauth and rosetta. The Login interface is only for a few co-opted people who will run the site. So I will not translate it.

For those templates I have customized, I can simply remove all "trans" blocks, but what about others? I've tried to copy all templates locally and to use:

ROSETTA_EXCLUDE_PATHS = (os.path.join(BASE_DIR, 'templates/'),)

I've also tried that:

ROSETTA_EXCLUDED_APPLICATIONS = ('allauth')

It is not vital, but it is annoying because a lot of messages are left to translate, while nobody cares. Only the public visitor interface will be translated. Not the admin,backoffice,login...

How could I exclude apps and/or Paths ?


Solution

  • For paths, there is actually a typo in the docs. It should be ROSETTA_EXCLUDED_PATHS. The pertinent code from settings.py is:

    # Exclude paths defined in this list from being searched (usually ends with "locale")
    ROSETTA_EXCLUDED_PATHS = getattr(settings, 'ROSETTA_EXCLUDED_PATHS', ())