{"action":"reopened","issue":{"url":"https://api.github.com/repos/tinganho/express-request-language/issues/16","repository_url":"https://api.github.com/repos/tinganho/express-request-language","labels_url":"https://api.github.com/repos/tinganho/express-request-language/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/tinganho/express-request-language/issues/16/comments","events_url":"https://api.github.com/repos/tinganho/express-request-language/issues/16/events","html_url":"https://github.com/tinganho/express-request-language/issues/16","id":372513169,"node_id":"MDU6SXNzdWUzNzI1MTMxNjk=","number":16,"title":"Add feature to set a default language","user":{"login":"guiihlopes","id":14032146,"node_id":"MDQ6VXNlcjE0MDMyMTQ2","avatar_url":"https://avatars3.githubusercontent.com/u/14032146?v=4","gravatar_id":"","url":"https://api.github.com/users/guiihlopes","html_url":"https://github.com/guiihlopes","followers_url":"https://api.github.com/users/guiihlopes/followers","following_url":"https://api.github.com/users/guiihlopes/following{/other_user}","gists_url":"https://api.github.com/users/guiihlopes/gists{/gist_id}","starred_url":"https://api.github.com/users/guiihlopes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guiihlopes/subscriptions","organizations_url":"https://api.github.com/users/guiihlopes/orgs","repos_url":"https://api.github.com/users/guiihlopes/repos","events_url":"https://api.github.com/users/guiihlopes/events{/privacy}","received_events_url":"https://api.github.com/users/guiihlopes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-22T13:06:10Z","updated_at":"2018-10-31T17:05:39Z","closed_at":null,"author_association":"NONE","body":"It would be nice if have some way to pass a param like `queryName` to set a default language. \r\nSo, if there isn't a cookie already set and if you pass a prop like: `defaultLanguage`, then set the default language. I think it could be a very nice feature.\r\n\r\nExample: \r\n\r\n```\r\nconst languages = ['en', 'pt']\r\n\r\nserver.use(\r\n    requestLanguage({\r\n      languages: languages,\r\n      queryName: 'lang',\r\n      defaultLanguage: 'en',\r\n      cookie: {\r\n        name: 'DEFAULT_LANGUAGE',\r\n        options: { maxAge: 24 * 3600 * 1000 }\r\n      }\r\n    })\r\n  )\r\n```\r\n\r\nThe first time if there is no cookie already set, it would be 'en', ignoring the accept language... \r\n\r\nWDYT about it?"}}
{"actor":{"display_login":"tinganho"}}