EXCLUDED_APPLICATIONS settings
- Which version of Django are you using?: 5.0.4
- Which version of django-rosetta are you using?: 0.10.0
- Have you looked trough recent issues and checked this isn't a duplicate? I did!
I am trying to use this settings, but whatever I try, I see no effect. I see there are unit tests and they are working so everything seems fine. I even literally tried:
ROSETTA_EXCLUDED_APPLICATIONS = INSTALLED_APPS
But whatever I do, I see in the list all the translation files of all the apps. Anything obvious I am doing wrong?
Yes, I agree that the way we currently find discover locale paths is too aggressive: we essentially try to find all possible locations for PO files using
- Django's app catalog
- by scanning the local project root and
- looking in
settings.LOCALE_PATHS.
We only exclude applications from the first list, but if for some reason your app also matches 2 or 3, we can't easily detect that.
Also, you might want to try using ROSETTA_EXCLUDED_PATHS instead, e.g.
ROSETTA_EXCLUDED_PATHS = ("/home/marco/Code/django-rosetta/testproject/locale",)
Will exclude this:
Thanks for reply. In the end, I simply want only to translate my local apps and nothing else. Of course the best would be to have a boolean settings that allow me to filter that.
I read about EXCLUDED_PATHS, but the fact that it has to be absolute makes it much less usable.
Nonetheless, I don't see why EXCLUDED_APPS shouldn't work, any idea why it doesn't?
Nonetheless, I don't see why EXCLUDED_APPS shouldn't work, any idea why it doesn't?
Yes, as I mentioned above we look for catalogs by app (in which case the exclusion works) and by various other means (not necessarily by app) in which cases EXCLUDED_APPS doesn't have any effect.
The relevant bit of code is here: https://github.com/mbi/django-rosetta/blob/develop/rosetta/poutil.py#L33 if you'd like to take a closer look. Pull requests are as always welcome. :pray:
Thanks, and is this supposed to be expected behaviour?
Looking deeper into the code, I basically only want "project" po_filter: https://github.com/mbi/django-rosetta/blob/c76d8296b2f46c536b2bbfab8c83a90a49e57364/rosetta/views.py#L68
I don't want people to see or translate third party or django apps at this point. We really translate only our frontend and don't need this. This would only confuse translators + it unnecessarily gives out sensitive information about project paths on the server.
What would you say to making this settings configurable? {"all", "django", "third-party", "project"}
If you are positive about it, what changes would that involve besides getting this from settings + changes in template?
Lastly, I was trying to run tests and play with it very slightly and some tests were failing, I haven't found any instructions on how to set it up, is there a doc? It may be some external component missing that I don't have installed, I really haven't looked much into that.