[PATCH] Disable i18n machinery, use correct locale

Stephen Finucane stephen at that.guru
Wed Nov 6 17:53:47 AEDT 2019

Two issues here. Firstly, the use of the 'USE_I18N'. The Django docs
describe this as such:

  A boolean that specifies whether Django’s translation system should
  be enabled. This provides an easy way to turn it off, for performance.
  If this is set to False, Django will make some optimizations so as not
  to load the translation machinery.

We don't do translations and won't until such a time as someone comes
asking for them. Optimize things accordingly by setting 'USE_I18N' to
False and removing the now-unnecessary 'LANGUAGE_CODE' setting.

Secondly, the use of en-AU is a bit of a lie since our UI is actually
written in US English (or should be). The primary reason for a lang tag
to be present is to assist screenreaders and other accessibility tools,
so make their lives easier by reflecting the truth.

Signed-off-by: Stephen Finucane <stephen at that.guru>
Cc: Andrew Donnellan <ajd at linux.ibm.com>
Cc: Daniel Axtens <dja at axtens.net>
 patchwork/settings/base.py | 4 +---
 templates/base.html        | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git patchwork/settings/base.py patchwork/settings/base.py
index b86cdc27..86612d7a 100644
--- patchwork/settings/base.py
+++ patchwork/settings/base.py
@@ -36,9 +36,7 @@ MIDDLEWARE = [
 TIME_ZONE = 'Australia/Canberra'
-LANGUAGE_CODE = 'en-au'
-USE_I18N = True
+USE_I18N = False
 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
diff --git templates/base.html templates/base.html
index 40b6cda6..27db7f52 100644
--- templates/base.html
+++ templates/base.html
@@ -1,6 +1,6 @@
 {% load static %}
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en-AU">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
   <title>{% block title %}Patchwork{% endblock %} - Patchwork</title>

More information about the Patchwork mailing list