{ "id": "118317", "key": "ALOY-781", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-10-02T18:08:02.000+0000", "created": "2013-08-12T13:37:51.000+0000", "priority": null, "labels": [ "alloy", "extraction", "i18n" ], "versions": [], "issuelinks": [], "assignee": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-01-28T23:19:51.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "I would to have an option for {{alloy extract-i18n}} to remove strings that can not be found in the project's JS, TSS and XML files.\r\n\r\nOf course this requires TC-2732 to be resolved because ATM, {{extract-i18n}} does not account for XML files and {{textid}}-like properties.\r\n\r\nI will attach a PR for this.", "attachment": [], "flagged": false, "summary": "Add option to extract-i18n to remove strings not used in code", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "Alloy 1.2.0-alpha6", "comment": { "comments": [ { "id": "265945", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR: https://github.com/appcelerator/alloy/pull/218", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-08-12T13:43:22.000+0000", "updated": "2013-08-12T13:43:22.000+0000" }, { "id": "265962", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you better define what \"unused\" strings are?", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-12T15:14:52.000+0000", "updated": "2013-08-12T15:14:52.000+0000" }, { "id": "265998", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This seems a little dangerous from my perspective and likely to be misused with bad results. The reason I've allowed extract-i18n in as it is with regex search instead of full AST parsing is that its changes are non-invasive. The changes are additive. That's not to say that we can't do it, I just think the interface will need to be more explicit.\n\nMakes me wonder if the command should be structured differently, with subcommands:\n\n{code}alloy i18n extract ...{code}\n\ninstead of \n\n{code}alloy extract-i18n ...{code}\n\nand then add \n\n{code}alloy i18n clean ...{code}\n\nso that the very different behavior is more explicit. Not sure, but I do know that if this command gets into the business of actually removing entries, then I don't want it to be regex driven anymore and it should fully parse the JS/TSS into an AST and manipulate that way. The views would naturally be parsed as XML and evaluated in a similar fashion.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-12T17:56:13.000+0000", "updated": "2013-08-12T17:56:13.000+0000" }, { "id": "266185", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Well I don't actually remove the strings, just wrap them in comments. But I do agree that an {{extract}} command also removing stuff might be unexpected behavior. We could do:\r\n\r\n{code}\r\nalloy i18n extract\r\nalloy i18n clean\r\nalloy i18n sync // = extract + clean\r\n{code}\r\n\r\nI also agree that proper AST and XML parsing is justifiable, also taking ALOY-782 into consideration (which is required for this issue anyway).", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-08-13T12:45:57.000+0000", "updated": "2013-08-13T12:45:57.000+0000" }, { "id": "273643", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After discussion with Fokke, this ticket will be closed. Further effort here may be made in the next major version of Alloy, but that will likely be covered in entirely separate issues.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-02T18:08:02.000+0000", "updated": "2013-10-02T18:08:02.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }