{"action":"created","issue":{"url":"https://api.github.com/repos/i18next/react-i18next/issues/240","repository_url":"https://api.github.com/repos/i18next/react-i18next","labels_url":"https://api.github.com/repos/i18next/react-i18next/issues/240/labels{/name}","comments_url":"https://api.github.com/repos/i18next/react-i18next/issues/240/comments","events_url":"https://api.github.com/repos/i18next/react-i18next/issues/240/events","html_url":"https://github.com/i18next/react-i18next/issues/240","id":216290941,"number":240,"title":"returnObjects: true returns keys rather than the translation","user":{"login":"mjmasn","id":2977095,"avatar_url":"https://avatars3.githubusercontent.com/u/2977095?v=3","gravatar_id":"","url":"https://api.github.com/users/mjmasn","html_url":"https://github.com/mjmasn","followers_url":"https://api.github.com/users/mjmasn/followers","following_url":"https://api.github.com/users/mjmasn/following{/other_user}","gists_url":"https://api.github.com/users/mjmasn/gists{/gist_id}","starred_url":"https://api.github.com/users/mjmasn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjmasn/subscriptions","organizations_url":"https://api.github.com/users/mjmasn/orgs","repos_url":"https://api.github.com/users/mjmasn/repos","events_url":"https://api.github.com/users/mjmasn/events{/privacy}","received_events_url":"https://api.github.com/users/mjmasn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-23T04:15:45Z","updated_at":"2017-03-23T13:54:35Z","closed_at":"2017-03-23T13:53:39Z","body":"I will preface this by saying I'm probably doing this wrong with regards to the translate function - I have been wrapping my components as follows:\r\n\r\n```js\r\nexport default translate([])(SomeComponent);\r\n```\r\n\r\nNot providing any namespaces works fine for any plain namespace and translation. When using `returnObjects: true` it stops working and just returns an object or array of keys.\r\n\r\nI get that I'm supposed to be specifying namespaces in `translate(['ns1','ns2'])` but is there a technical reason it not to work without, given that it does work for returning strings. Would just like to avoid having to specify 6 or 7 namespaces every time I want an object in a component.\r\n\r\nFor clarification:\r\n*ns1.json*\r\n```json\r\n{\r\n    \"stringValue\": \"Some value\",\r\n    \"myArray\": [\"a\",\"b\",\"c\"]\r\n}\r\n```\r\n\r\n*index.js*\r\n```js\r\n// ... \r\n\r\nconst resources = {\r\n    ns1: require('./ns1.json')\r\n    // ns2: ...\r\n};\r\n\r\ni18next.init({\r\n    lng: 'en',\r\n    fallbackLng: 'en',\r\n    resources\r\n}, (err, t) => { \r\n    // ReactDOMServer.renderToStaticMarkup(...)\r\n})\r\n```\r\n\r\n*component.js*\r\n```js\r\nimport _ from 'lodash';\r\nimport React from 'react';\r\nimport { translate } from 'react-i18next';\r\n\r\nconst SomeComponent = function (props) {\r\n    const { t } = props;\r\n\r\n    return <div>\r\n        <div>\r\n            {_.map(t('ns1:myArray', { returnObjects: true }), (item) => {\r\n                return <p>{item}</p>\r\n            })}\r\n        </div>\r\n    </div>\r\n}\r\n\r\nSomeComponent.propTypes = { \r\n    t: React.PropTypes.func.isRequired\r\n};\r\n\r\nexport default translate([])(SomeComponent);\r\n```\r\n\r\nGives the following html:\r\n```html\r\n<div>\r\n    <div>\r\n        <p>myArray.0</p>\r\n        <p>myArray.1</p>\r\n        <p>myArray.2</p>\r\n    </div>\r\n</div>\r\n```"},"comment":{"url":"https://api.github.com/repos/i18next/react-i18next/issues/comments/288726100","html_url":"https://github.com/i18next/react-i18next/issues/240#issuecomment-288726100","issue_url":"https://api.github.com/repos/i18next/react-i18next/issues/240","id":288726100,"user":{"login":"jamuhl","id":977772,"avatar_url":"https://avatars0.githubusercontent.com/u/977772?v=3","gravatar_id":"","url":"https://api.github.com/users/jamuhl","html_url":"https://github.com/jamuhl","followers_url":"https://api.github.com/users/jamuhl/followers","following_url":"https://api.github.com/users/jamuhl/following{/other_user}","gists_url":"https://api.github.com/users/jamuhl/gists{/gist_id}","starred_url":"https://api.github.com/users/jamuhl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamuhl/subscriptions","organizations_url":"https://api.github.com/users/jamuhl/orgs","repos_url":"https://api.github.com/users/jamuhl/repos","events_url":"https://api.github.com/users/jamuhl/events{/privacy}","received_events_url":"https://api.github.com/users/jamuhl/received_events","type":"User","site_admin":false},"created_at":"2017-03-23T13:54:35Z","updated_at":"2017-03-23T13:54:35Z","body":"thanks belongs to you - for finding and fixing..."}}
{"actor":{"display_login":"jamuhl"}}