{"action":"created","issue":{"url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/210","repository_url":"https://api.github.com/repos/AliSoftware/SwiftGen","labels_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/210/comments","events_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/210/events","html_url":"https://github.com/AliSoftware/SwiftGen/issues/210","id":191469186,"number":210,"title":"outputting [comment] as part of custom strings template","user":{"login":"simonstewart","id":1233278,"avatar_url":"https://avatars.githubusercontent.com/u/1233278?v=3","gravatar_id":"","url":"https://api.github.com/users/simonstewart","html_url":"https://github.com/simonstewart","followers_url":"https://api.github.com/users/simonstewart/followers","following_url":"https://api.github.com/users/simonstewart/following{/other_user}","gists_url":"https://api.github.com/users/simonstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/simonstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonstewart/subscriptions","organizations_url":"https://api.github.com/users/simonstewart/orgs","repos_url":"https://api.github.com/users/simonstewart/repos","events_url":"https://api.github.com/users/simonstewart/events{/privacy}","received_events_url":"https://api.github.com/users/simonstewart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-24T09:22:14Z","updated_at":"2016-11-24T15:22:40Z","closed_at":null,"body":"I've added a new strings template, but need to output the [comment] for each of the strings to the *NSLocalizedString* call.\r\n\r\nIdeally via something like:\r\n{{string.comment}}\r\n\r\nSimilar to how we can use:\r\n{{string.translation}} and {{string.key}}\r\n\r\nIs this possible?"},"comment":{"url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/comments/262799636","html_url":"https://github.com/AliSoftware/SwiftGen/issues/210#issuecomment-262799636","issue_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/210","id":262799636,"user":{"login":"AliSoftware","id":216089,"avatar_url":"https://avatars.githubusercontent.com/u/216089?v=3","gravatar_id":"","url":"https://api.github.com/users/AliSoftware","html_url":"https://github.com/AliSoftware","followers_url":"https://api.github.com/users/AliSoftware/followers","following_url":"https://api.github.com/users/AliSoftware/following{/other_user}","gists_url":"https://api.github.com/users/AliSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/AliSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliSoftware/subscriptions","organizations_url":"https://api.github.com/users/AliSoftware/orgs","repos_url":"https://api.github.com/users/AliSoftware/repos","events_url":"https://api.github.com/users/AliSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/AliSoftware/received_events","type":"User","site_admin":false},"created_at":"2016-11-24T15:22:40Z","updated_at":"2016-11-24T15:22:40Z","body":"Sadly it's not easy (ready: quite complex and probably not worth it) to parse comments.\r\nIf we revert to parsing the `Localizable.strings` as a text file line by line, we'll reintroduce the bug when the translations are spread on multiple lines.\r\nBut even though, parsing comments during text parsing might proves tricky. Comments might appear anywhere in a line but we must not detect a string containing `\"foo // bar\"` as being a `// bar\"` comment, and detecting multi-line comments would prove to be complex to parse properly without any risk of false positives (what about `/* foo /* bar // baz */ */`?)…\r\n\r\nMaybe except if someone wrote a Swift text parser for `Localizable.strings` files that is dedicated to that and highly tested for all those side cases, in that case we could integrate that pod in our project, but if it doesn't exist yet I don't think it's worth it creating it given how complex it could become to handle all tricky cases."}}
{"actor":{"display_login":"AliSoftware"}}