[ckan-changes] commit/ckan: dread: [lib]: #1452 Browser lang detection temporarily disabled, pending better User Experience - see ticket.

Bitbucket commits-noreply at bitbucket.org
Mon Nov 7 16:26:30 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/78ffe0d52629/
changeset:   78ffe0d52629
branch:      release-v1.5
user:        dread
date:        2011-11-07 17:26:08
summary:     [lib]: #1452 Browser lang detection temporarily disabled, pending better User Experience - see ticket.
affected #:  3 files

diff -r f84a862ccc064ba7e2e31d3e8fb2db2fc4b2821e -r 78ffe0d52629b0020edceac1df65f1a4a9336012 ckan/lib/i18n.py
--- a/ckan/lib/i18n.py
+++ b/ckan/lib/i18n.py
@@ -158,11 +158,13 @@
     if session.get('locale'):
         # First look for locale saved in the session (by home controller)
         locales.append(Locale.parse(session.get('locale')))
-    else:
-        # Next try languages in the HTTP_ACCEPT_LANGUAGE header
-        locale = Locales().negotiate_known_locale(request.languages)
-        if locale:
-            locales.append(locale)
+
+    # Browser language detection disabled temporarily - see #1452
+##    else:
+##        # Next try to detect languages in the HTTP_ACCEPT_LANGUAGE header
+##        locale = Locales().negotiate_known_locale(request.languages)
+##        if locale:
+##            locales.append(locale)
 
     # Next try the default locale in the CKAN config file
     locales.append(Locales().get_default_locale())


diff -r f84a862ccc064ba7e2e31d3e8fb2db2fc4b2821e -r 78ffe0d52629b0020edceac1df65f1a4a9336012 ckan/tests/functional/test_home.py
--- a/ckan/tests/functional/test_home.py
+++ b/ckan/tests/functional/test_home.py
@@ -85,14 +85,15 @@
         res = self.app.get(offset)
         assert '<strong>TEST TEMPLATE_FOOTER_END TEST</strong>'
 
-    def test_locale_detect(self):
-        offset = url_for('home')
-        self.clear_language_setting()
-        res = self.app.get(offset, headers={'Accept-Language': 'de,pt-br,en'})
-        try:
-            assert 'Willkommen' in res.body, res.body
-        finally:
-            self.clear_language_setting()
+## Browser lang detection disabled - see #1452
+##    def test_locale_detect(self):
+##        offset = url_for('home')
+##        self.clear_language_setting()
+##        res = self.app.get(offset, headers={'Accept-Language': 'de,pt-br,en'})
+##        try:
+##            assert 'Willkommen' in res.body, res.body
+##        finally:
+##            self.clear_language_setting()
 
     def test_locale_negotiate(self):
         offset = url_for('home')


diff -r f84a862ccc064ba7e2e31d3e8fb2db2fc4b2821e -r 78ffe0d52629b0020edceac1df65f1a4a9336012 ckan/tests/lib/test_i18n.py
--- a/ckan/tests/lib/test_i18n.py
+++ b/ckan/tests/lib/test_i18n.py
@@ -132,23 +132,24 @@
     def test_handle_request__session(self):
         assert_equal(self.handle_request(session_language='fr'),
                      'fr')
+## Browser lang detection disabled - see #1452
 
-    def test_handle_request__header(self):
-        assert_equal(self.handle_request(languages_header=['de']),
-                     'de')
+##    def test_handle_request__header(self):
+##        assert_equal(self.handle_request(languages_header=['de']),
+##                     'de')
 
-    def test_handle_request__header_negotiate(self):
-        # Language so is not an option, so reverts to next one
-        assert_equal(self.handle_request(languages_header=['so_KE', 'de']),
-                     'de')
+##    def test_handle_request__header_negotiate(self):
+##        # Language so is not an option, so reverts to next one
+##        assert_equal(self.handle_request(languages_header=['so_KE', 'de']),
+##                     'de')
 
-    def test_handle_request__header_but_defaults(self):
-        # Language so is not an option, so reverts to default
-        assert_equal(self.handle_request(languages_header=['so_KE']),
-                     'en')
+##    def test_handle_request__header_but_defaults(self):
+##        # Language so is not an option, so reverts to default
+##        assert_equal(self.handle_request(languages_header=['so_KE']),
+##                     'en')
 
-    def test_handle_request__header_territory(self):
-        # Request for specific version of German ends up simply as de.
-        assert_equal(self.handle_request(languages_header=['fr_CA', 'en']),
-                     'fr')
+##    def test_handle_request__header_territory(self):
+##        # Request for specific version of German ends up simply as de.
+##        assert_equal(self.handle_request(languages_header=['fr_CA', 'en']),
+##                     'fr')

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list