{"action":"created","issue":{"url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/84","labels_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/84/comments","events_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/84/events","html_url":"https://github.com/AliSoftware/SwiftGen/issues/84","id":129065081,"number":84,"title":"Not able to parse multiple .strings files","user":{"login":"AndrewSB","id":3814772,"avatar_url":"https://avatars.githubusercontent.com/u/3814772?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewSB","html_url":"https://github.com/AndrewSB","followers_url":"https://api.github.com/users/AndrewSB/followers","following_url":"https://api.github.com/users/AndrewSB/following{/other_user}","gists_url":"https://api.github.com/users/AndrewSB/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewSB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewSB/subscriptions","organizations_url":"https://api.github.com/users/AndrewSB/orgs","repos_url":"https://api.github.com/users/AndrewSB/repos","events_url":"https://api.github.com/users/AndrewSB/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewSB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-27T08:05:10Z","updated_at":"2016-01-27T18:02:11Z","closed_at":null,"body":"I've been using swiftgen for a while with one project now, and I've finally noticed that it isn't properly parsing my `.strings` files -- something strange is going on.\r\n\r\nI have two currently: `Localizable.strings` and `Contant.strings`\r\nAnd in my build phase there are these two lines: \r\n```\r\n/usr/local/bin/swiftgen strings \"${PROJECT_DIR}/${PROJECT_NAME}/Supporting Files/Localizable.strings\" --enumName \"Localizable\" --output \"${PROJECT_DIR}/${PROJECT_NAME}/Supporting Files/Constants/Localizable_Strings.swift\"\r\n/usr/local/bin/swiftgen strings \"${PROJECT_DIR}/${PROJECT_NAME}/Supporting Files/Constant.strings\" --enumName \"Contants\" --output \"${PROJECT_DIR}/${PROJECT_NAME}/Supporting Files/Constants/Constant_Strings.swift\"\r\n```\r\n\r\nThe generated files (both of them) show all the strings I have in my `.strings` files, with the correct content in the comment above each enum case.\r\n\r\nThe issue appears at runtime. If I use `tr()` on any of the cases from the generated `Localizable.strings` enum, it works great, but if I try to `tr()` a `Constant.strings` case, it just returns the enum key, instead of the value (for eg. a line which is `\"login.facebookreadpermissions\" = \"email, user_birthday, public_profile, user_friends\";`, when evaluated with `tr()` returns the string `login.facebookreadpermissions` instead of the expected value)\r\n\r\nAny ideas what could be wrong? I've checked to make sure `Contant.strings` is in the Copy Bundle Resources build phase"},"comment":{"url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/comments/175774238","html_url":"https://github.com/AliSoftware/SwiftGen/issues/84#issuecomment-175774238","issue_url":"https://api.github.com/repos/AliSoftware/SwiftGen/issues/84","id":175774238,"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-01-27T18:02:11Z","updated_at":"2016-01-27T18:02:11Z","body":"That's not a problem on your part, but on mine, that's because my implementation of `tr()` in the template use `NSLocalizedString` (and doesn't use the `tableName:` parameter) so it always looks at the string in the default strings file, which is `Localizable.strings`\r\n\r\nI recently [added the `tableName` key in the Stencil context](https://github.com/AliSoftware/SwiftGen/blob/master/GenumKit/Stencil/Contexts.swift#L131) which means that theoretically you should [create a custom template](https://github.com/AliSoftware/SwiftGen/blob/master/documentation/Templates.md) based on the default one, but which make use of this `tableName` variable in the template in the `tr` implementation, [instead of using the `NSLocalizedString` without a table name like I do so far](https://github.com/AliSoftware/SwiftGen/blob/master/templates/strings-default.stencil#L30-L38).\r\n\r\nThis should actually be pretty straightforward to do, so don't hesitate to try it.\r\n\r\nIf you manage to create a nice template taking that `tableName` into account, don't hesitate to make a PR: I'd gladly add such a template as part of the templates bundled with SwiftGen itself."}}