Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default system locale #87

Merged
merged 2 commits into from
Feb 17, 2020

Conversation

gavinelder
Copy link
Contributor

@gavinelder gavinelder commented Feb 14, 2020

Background

Set a system locale to prevent errors such as this due to system locale falling back to use the language setting on devices which don't inherit default locale from the system.

  File "/usr/local/lib/python3.7/locale.py", line 587, in getlocale
    return _parse_localename(localename)
  File "/usr/local/lib/python3.7/locale.py", line 495, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: en-US

Further to this

Removed logic using LANGUAGE_CODE = locale.getdefaultlocale()[0] as locales as languages are no longer supported with django.
https://github.com/pope1ni/django/blob/5dabb6002ed773c150da4bd3aee756df75d218c2/tests/check_framework/test_translation.py#L23-L31

@gavinelder gavinelder changed the title [WIP] Unpack lang settings unpick locale settings flake Feb 14, 2020
@gavinelder gavinelder changed the title unpick locale settings flake Don't merge testing --- unpick locale settings flake Feb 14, 2020
@gavinelder gavinelder changed the title Don't merge testing --- unpick locale settings flake Set system locale Feb 14, 2020
@gavinelder gavinelder changed the title Set system locale Set default system locale Feb 17, 2020
@grahamgilbert grahamgilbert merged commit 47cdb3a into grahamgilbert:master Feb 17, 2020
@gavinelder gavinelder deleted the lang_settings branch February 17, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants