Djangorestframework-simplejwt: How can I install the location file available inside the /locale folder?

Created on 18 Apr 2020  路  2Comments  路  Source: jazzband/djangorestframework-simplejwt

Hi!
I have installed django-rest-framework-simplejwt and notice it doesn't come with the languages available inside the rest_framework_simplejwt/locale folder.

What's the best approach to install it? Do I have to manually download it from this repository?

Thank you very much in advance!

bug question wontfix

Most helpful comment

Just noticed this too, seems like the wheel doesn't include the locale files but the tar version has them.

I think adding include_package_data=true to setup.py solves it.
Another way would be to include only the compiled .po files

I will test it and open a PR as soon as I can

All 2 comments

Just noticed this too, seems like the wheel doesn't include the locale files but the tar version has them.

I think adding include_package_data=true to setup.py solves it.
Another way would be to include only the compiled .po files

I will test it and open a PR as soon as I can

Hmm #117 should've fixed it... Is this still an issue? If so, please open a PR (it was merged a month earlier with the include_package_data=True name. Maybe it should be lowercase?).

Edit: Looking at setuptools docs, it seems like the reason it only works on tar is because we're using datafiles. Due to having translations not using Python files, zip will not work (also due to setup.py now having zip_safe=False). This is the reason from the docs:

Currently, this analysis is extremely conservative: it will consider the project unsafe if it contains any C extensions or datafiles whatsoever. This does not mean that the project can鈥檛 or won鈥檛 work as a zipfile! It just means that the bdist_egg authors aren鈥檛 yet comfortable asserting that the project will work. If the project contains no C or data files, and does no __file__ or __path__ introspection or source code manipulation, then there is an extremely solid chance the project will work when installed as a zipfile.

If you have any concerns or more issues, @Andrew-Chen-Wang (i.e. mention me) and I will reopen this issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings