I think this was initially fixed in this issue in 2006 and an update to the docs about it in 2011. So has this regressed since, or is there something else I should be doing regarding internationalisation to get it working?
<conjecture>
This turns out to be far more interesting than I thought - and may possibly be a documentation issue associated with the changes made for Django 4.0 (See Django 4.0 release notes | Django documentation | Django)
As you have pointed out above, setting USE_I18N = False does not appear to affect the calendar widget in the admin. (I don’t have any idea how it this would affect anything else. I don’t have anything rendering a date that would pay attention to the first day of the week.)
The get_format function in django.utils.formats still makes a reference to USE_L10N and _USE_L10N_INTERNAL - neither of which are defined in django.conf.global_settings any more.
It now appears that to make this change, you need to supply a custom formats.py file, with the change made inside of it. (Adding said formats.py file does change the admin widget, so at least that works.)
At this point, I think I’ve taken this about as far as I can.
<opinion>
Something doesn’t seem right here - but what to do about it is beyond me.
I think there’s a case that could be made that there’s some work to do in this area. But whether that’s just some documentation cleanup, or actual code changes to the affected functions… </opinion>
<conjecture>
It appears to me that the removal of USE_L10N has effectively deactivated settings related to formats that are documented in Settings | Django documentation | Django
I’ve been unable to find any way to get those settings to directly take effect. (It’s not just the FIRST_DAY_OF_WEEK setting - a handful of tickets have been created identifying variations on this basic issue.) </conjecture>
Assuming the above is correct, I see at least two options:
Remove those settings from the settings docs, since they don’t do anything when placed in settings.py.
Change the code to allow the settings to “override” or “supersede” what is defined in the formats.py file.
<opinion>
Removing the entries from the docs does avoid some confusion. But then the solution of requiring that these settings be changed in individual formats.py files feels “unsatisfactory”. (Do I really need to copy / change all the formats.py files in django.conf.locale if I need this to work across translations?)
I think I’d be more in favor of allowing the settings.py entries to override the formats.py, but I’m not sure what that would look like in practice. </opinion>
I totally agree with your opinion. Removing the entries from the docs is unsatisfactory and djangonauts may want to customize those settings as well.
On my local, I changed the get_format function in the formats.py. I use the settings from django.conf to get the USE_I18N from the settings.py, and I set use_l10n in the get_format function as the value of USE_I18N when the use_l10n is None. It changed the FIRST_DAY_OF_WEEK when I set USE_I18N=False.
if use_l10n is None:
use_l10n = getattr(settings, 'USE_I18N')
This is my basic idea to fix the issues related to the USE_L10N entry for v5.0 or more. But the names do not match each other. I’ll keep my eye on this topic and try to modify/remove the codes related to the USE_L10N.