{"action":"created","issue":{"url":"https://api.github.com/repos/stefalda/react-localization/issues/49","repository_url":"https://api.github.com/repos/stefalda/react-localization","labels_url":"https://api.github.com/repos/stefalda/react-localization/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/stefalda/react-localization/issues/49/comments","events_url":"https://api.github.com/repos/stefalda/react-localization/issues/49/events","html_url":"https://github.com/stefalda/react-localization/issues/49","id":264978363,"number":49,"title":"import strings to anther class","user":{"login":"shayja","id":136335,"avatar_url":"https://avatars0.githubusercontent.com/u/136335?v=4","gravatar_id":"","url":"https://api.github.com/users/shayja","html_url":"https://github.com/shayja","followers_url":"https://api.github.com/users/shayja/followers","following_url":"https://api.github.com/users/shayja/following{/other_user}","gists_url":"https://api.github.com/users/shayja/gists{/gist_id}","starred_url":"https://api.github.com/users/shayja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shayja/subscriptions","organizations_url":"https://api.github.com/users/shayja/orgs","repos_url":"https://api.github.com/users/shayja/repos","events_url":"https://api.github.com/users/shayja/events{/privacy}","received_events_url":"https://api.github.com/users/shayja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-12T15:09:05Z","updated_at":"2017-10-12T18:58:36Z","closed_at":null,"author_association":"NONE","body":"I created a language strings file e.g.:\r\n\r\nimport LocalizedStrings from 'react-localization';\r\n \r\nlet strings = new LocalizedStrings({\r\n en:{\r\n   how:\"How do you want your egg today?\",\r\n },\r\n it: {\r\n   how:\"Come vuoi il tuo uovo oggi?\"\r\n }\r\n});\r\n\r\nThe API works OK if I use the same file\r\nstrings.setLanguage('en');\r\nconsole.log(strings.how);\r\n\r\nWhen I call the API from another file the strings object is empty ({}) and strings.how will return undefined:\r\n\r\n\r\nimport React from 'react';\r\n\r\n//the import line:\r\n**import strings from '../common/LocalizedStrings';**\r\n\r\nexport default class MyPageNameHere extends React.Component{\r\n\tconstructor (props) {\r\n\tsuper(props);\r\n\t\r\n\t**console.log(strings);\r\n\tconsole.log(strings.how);**\r\n  }\r\n}\r\n\r\nHope anyone can help.\r\n"},"comment":{"url":"https://api.github.com/repos/stefalda/react-localization/issues/comments/336233494","html_url":"https://github.com/stefalda/react-localization/issues/49#issuecomment-336233494","issue_url":"https://api.github.com/repos/stefalda/react-localization/issues/49","id":336233494,"user":{"login":"stefalda","id":4984558,"avatar_url":"https://avatars0.githubusercontent.com/u/4984558?v=4","gravatar_id":"","url":"https://api.github.com/users/stefalda","html_url":"https://github.com/stefalda","followers_url":"https://api.github.com/users/stefalda/followers","following_url":"https://api.github.com/users/stefalda/following{/other_user}","gists_url":"https://api.github.com/users/stefalda/gists{/gist_id}","starred_url":"https://api.github.com/users/stefalda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefalda/subscriptions","organizations_url":"https://api.github.com/users/stefalda/orgs","repos_url":"https://api.github.com/users/stefalda/repos","events_url":"https://api.github.com/users/stefalda/events{/privacy}","received_events_url":"https://api.github.com/users/stefalda/received_events","type":"User","site_admin":false},"created_at":"2017-10-12T18:58:36Z","updated_at":"2017-10-12T18:58:36Z","author_association":"OWNER","body":"Do you export the string variable?"}}
{"actor":{"display_login":"stefalda"}}