{"action":"created","issue":{"url":"https://api.github.com/repos/jsocol/django-waffle/issues/156","labels_url":"https://api.github.com/repos/jsocol/django-waffle/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/jsocol/django-waffle/issues/156/comments","events_url":"https://api.github.com/repos/jsocol/django-waffle/issues/156/events","html_url":"https://github.com/jsocol/django-waffle/pull/156","id":62729002,"number":156,"title":"use django.utils.translation for flag languages","user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-18T16:00:13Z","updated_at":"2015-04-14T13:22:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jsocol/django-waffle/pulls/156","html_url":"https://github.com/jsocol/django-waffle/pull/156","diff_url":"https://github.com/jsocol/django-waffle/pull/156.diff","patch_url":"https://github.com/jsocol/django-waffle/pull/156.patch"},"body":"Flags use `request.LANGUAGE_CODE` to check for languages. That requires `django.middleware.locale.LocaleMiddleware`, which isn't explained in the docs.\r\n\r\nThis PR changes flag languages logic to use `django.utils.translation` above the `LocaleMiddleware` so that projects using other locale middlewares can still use waffle Flag languages feature.\r\n\r\nIf this is a WONTFIX, I'll send another PR that adds the `django.middlware.locale.LocaleMiddlware` requirement to the docs and the admin site interface."},"comment":{"url":"https://api.github.com/repos/jsocol/django-waffle/issues/comments/92827556","html_url":"https://github.com/jsocol/django-waffle/pull/156#issuecomment-92827556","issue_url":"https://api.github.com/repos/jsocol/django-waffle/issues/156","id":92827556,"user":{"login":"groovecoder","id":71928,"avatar_url":"https://avatars.githubusercontent.com/u/71928?v=3","gravatar_id":"","url":"https://api.github.com/users/groovecoder","html_url":"https://github.com/groovecoder","followers_url":"https://api.github.com/users/groovecoder/followers","following_url":"https://api.github.com/users/groovecoder/following{/other_user}","gists_url":"https://api.github.com/users/groovecoder/gists{/gist_id}","starred_url":"https://api.github.com/users/groovecoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groovecoder/subscriptions","organizations_url":"https://api.github.com/users/groovecoder/orgs","repos_url":"https://api.github.com/users/groovecoder/repos","events_url":"https://api.github.com/users/groovecoder/events{/privacy}","received_events_url":"https://api.github.com/users/groovecoder/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T13:22:00Z","updated_at":"2015-04-14T13:22:00Z","body":"The test fails:\r\n```\r\n======================================================================\r\nFAIL: test_languages (waffle.tests.test_waffle.WaffleTests)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/lcrouch/code/django-waffle/waffle/tests/test_waffle.py\", line 109, in test_languages\r\n    self.assertEqual(b'on', response.content)\r\nAssertionError: 'on' != 'off'\r\n```\r\nSo, this feature seems to require either:\r\n* [ ] `django.middleware.locale.LocaleMiddleware` (master branch)\r\n\r\nor\r\n\r\n* [ ] `USE_I18N = True` (this branch)\r\n\r\nWhichever one is best, we should at least document the requirement in the docs."}}