{ "id": "78723", "key": "TIMOB-4886", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11363", "description": "Mobile 1.8.0 M10", "name": "Sprint 2011-31", "archived": true, "released": true, "releaseDate": "2011-08-08" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-10-27T14:32:11.000+0000", "created": "2011-08-03T12:03:20.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "string" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-10-27T14:32:21.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When using the String.format function, it works as expected when using the interpolation such as {{String.format('inserted value is %s', 'expected')}}.\r\n\r\nHowever, when using the sequence syntax such as {{String.format('inserted value is %1$s', 'expected')}} garbled characters are returned where the interpolation is expected.\r\n\r\nCode to replicate this issue below.\r\n\r\n{code:javascript|title=app.js}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor: '#FFF'\r\n});\r\n\r\nvar text = \"String.format with %s interpolation - \" + String.format('value = %s', 'correct');\r\ntext += \"\\nString.format with %1$s and %2$s interpolation - \" + String.format('value = %1$s %2$s', 'correct1', 'correct2');\r\n\r\nwin.add(Titanium.UI.createLabel({\r\n text: text,\r\n color: '#000',\r\n left: 10,\r\n right: 10\r\n}));\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "String.format using sequence (%1$s) returns invalid string", "creator": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium SDK version: 1.7.2.97c3689\r\n* Platform & version: iOS 4.3, OSX 10.7 (Lion)\r\n* Device Details: iOS simulator and iOS device\r\n* Host Operating System: OSX 10.7\r\n* Titanium Studio build: 1.0.2.201107130739", "comment": { "comments": [ { "id": "161749", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Matt\r\n\r\nThanks for raising this ticket - it is a lot cleaner than your first. With this potential bug, are two files important in order to replicate the issue? Would you test with all your code in app.js to be certain? A single app.js file is always preferable to multiple files.\r\n\r\nI will correct the environment field for you. Please note these changes, so you know the information to provide with any new tickets.\r\n\r\nCheers\r\n", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-03T13:08:09.000+0000", "updated": "2011-08-03T13:08:09.000+0000" }, { "id": "161750", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Would you also provide the strings.xml file you used to test this, in a code block in the body of the ticket?\r\n\r\nCheers", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-03T13:08:57.000+0000", "updated": "2011-08-03T13:08:57.000+0000" }, { "id": "161754", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Paul, are you just trying to be difficult? I have provided a perfectly workable testing solution as two files yes, but that DOES NOT EFFECT the issue in any way whatsoever. Every Titanium App is more than one JS file, so why is this an issue? Seriously man, why are you putting up a barrier every time. Please pass this on as is, I have made the effort, now do your part please.\r\n\r\nAlso, if you look at the code, I am not using an Localisation strings, so no strings.xml file is necessary. The L method is never called, I am only using Strings.format", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T13:34:54.000+0000", "updated": "2011-08-03T13:34:54.000+0000" }, { "id": "161778", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "OK Matthew, you are now aware of the points to bear in mind, in all the tickets I have edited for you today. These are all explained in the guidelines at [Submitting Bug Reports|http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-SubmittingBugReports], which I urge you to read.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-03T16:13:01.000+0000", "updated": "2011-08-03T16:13:01.000+0000" }, { "id": "161791", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks Paul.\r\n\r\nI will bear that mind for future tickets.", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T23:57:39.000+0000", "updated": "2011-08-03T23:57:39.000+0000" }, { "id": "164050", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.v20110819142548\niPhone 4.3.4\niPad2 4.3.2\nMotorola Xoom 3.2\nNexus One 2.2.2", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-25T13:11:32.000+0000", "updated": "2011-08-25T13:11:32.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }