{"action":"opened","issue":{"url":"https://api.github.com/repos/python-babel/flask-babel/issues/147","repository_url":"https://api.github.com/repos/python-babel/flask-babel","labels_url":"https://api.github.com/repos/python-babel/flask-babel/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/python-babel/flask-babel/issues/147/comments","events_url":"https://api.github.com/repos/python-babel/flask-babel/issues/147/events","html_url":"https://github.com/python-babel/flask-babel/issues/147","id":380263863,"node_id":"MDU6SXNzdWUzODAyNjM4NjM=","number":147,"title":"@babel.localselector not called","user":{"login":"maltere","id":16132483,"node_id":"MDQ6VXNlcjE2MTMyNDgz","avatar_url":"https://avatars0.githubusercontent.com/u/16132483?v=4","gravatar_id":"","url":"https://api.github.com/users/maltere","html_url":"https://github.com/maltere","followers_url":"https://api.github.com/users/maltere/followers","following_url":"https://api.github.com/users/maltere/following{/other_user}","gists_url":"https://api.github.com/users/maltere/gists{/gist_id}","starred_url":"https://api.github.com/users/maltere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maltere/subscriptions","organizations_url":"https://api.github.com/users/maltere/orgs","repos_url":"https://api.github.com/users/maltere/repos","events_url":"https://api.github.com/users/maltere/events{/privacy}","received_events_url":"https://api.github.com/users/maltere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-13T14:54:06Z","updated_at":"2018-11-13T14:54:06Z","closed_at":null,"author_association":"NONE","body":"I have a problem using Flask Babel and python3.6.\r\n\r\nMy code is as following:\r\n\r\n    @babel.localeselector def get_locale():\r\n        lang_supported = app.config.get('LANGUAGES', [])\r\n\r\n        lang = request.accept_languages.best_match(lang_supported.keys())\r\n        print('de', lang_supported)\r\n        return lang\r\n\r\nI do not get anything printed at the console. I do not know what I did wrong.\r\n\r\nMy App is initiated as following in the same file:\r\n\r\n    app = Flask(__name__)\r\n    app.config.from_object(\"config\")\r\n    babel = Babel(app)\r\n\r\nIn my config file everything relevant to Babel is following:\r\n\r\n    LANGUAGES = {\r\n        'en': 'English',\r\n        'de': 'Deutsch' \r\n    }\r\n\r\n    # BABEL_TRANSLATION_DIRECTORIES = '/path/to/flask/translations'\r\n    # BABEL_DEFAULT_LOCALE = 'de'\r\n    # BABEL_DEFAULT_TIMEZONE = 'Europe/Berlin'\r\n\r\nWhile looking for some solutions, I also tried the commented lines.\r\n\r\nI was able to use pybabel and create my `.pot`, `.po`, `.mo`,  files. And I created my Translation for 'de'\r\n\r\nI do not find anything about, why my `print` statement is not executed.\r\nWhen I manually create a `context_processor` and call my `get_locale()`, the print statement appears as expected.\r\n\r\nPlease let me know, if you need something more for debugging. \r\n\r\nI have also tried getting an answer on [StackOverflow](https://stackoverflow.com/questions/53283417/babel-localselector-not-called)"}}
{"actor":{"display_login":"maltere"}}