What did you do?
I am attempting to use Arabic with the activate function and passing in ar instead of the full ar_SA.
What did you expect to happen?
Fall back to a reasonable default.
What actually happened?
[Errno 2] No translation file found for domain: 'humanize'
What versions are you using?
- OS: Linux
- Python: 3.10
- Humanize: 4.2
Code that causes the problem
The root of the issue appears to be that the translation provided by Humanize is for SA (Saudi Arabia) and the default for Python is
https://github.com/python/cpython/blob/main/Lib/locale.py#L916
My recommendation is to reduce the name of the translation directory down from ar_SA to just ar to encompass a greater range of Arabic speakers. Like the Django project has: https://github.com/django/django/blob/main/django/conf/locale/ar/LC_MESSAGES/django.po
Alternatively, it could be renamed to ar_AA to work with the native (to Python) fallback.
What did you do?
I am attempting to use Arabic with the
activatefunction and passing inarinstead of the fullar_SA.What did you expect to happen?
Fall back to a reasonable default.
What actually happened?
What versions are you using?
Code that causes the problem
The root of the issue appears to be that the translation provided by Humanize is for SA (Saudi Arabia) and the default for Python is
https://github.com/python/cpython/blob/main/Lib/locale.py#L916
My recommendation is to reduce the name of the translation directory down from
ar_SAto justarto encompass a greater range of Arabic speakers. Like the Django project has: https://github.com/django/django/blob/main/django/conf/locale/ar/LC_MESSAGES/django.poAlternatively, it could be renamed to
ar_AAto work with the native (to Python) fallback.