{ "id": "174034", "key": "AC-6339", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2019-08-20T14:50:20.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-12-25T23:19:29.000+0000", "status": { "description": "This issue is being actively worked on at the moment by the assignee.", "name": "In Progress", "id": "3", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [], "description": "Using localization with a localized string defined like this:\r\n\r\n{code:java}\r\n\r\n\tMy test %1$s, test same param %1$s\r\n\tMy test %1$s, test same param %1$s\r\n\r\n{code}\r\n\r\nCopy the above code into your `app/i18n/en/strings.xml` file.\r\n\r\nThen paste this code into the index:\r\n\r\n{code:java}\r\nvar count = 0;\r\n\r\nfunction doClick(e) {\r\n\tcount++;\r\n\tlet override = false;\r\n\tlet localizedString = '';\r\n\tlet label2 = undefined;\r\n\tlet description = `${count} - `;\r\n\tswitch (count) {\r\n\t\tcase 1:\r\n\t\t\tdescription += 'formatted=undefined & 1';\r\n\t\t\tlocalizedString = 'myTestLabel1';\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tdescription += 'formatted=undefined & 2';\r\n\t\t\tlocalizedString = 'myTestLabel1';\r\n\t\t\tlabel2 = '2';\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tdescription += 'formatted=false & 1';\r\n\t\t\tlocalizedString = 'myTestLabel2';\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tdescription += 'formatted=false & 2';\r\n\t\t\tlocalizedString = 'myTestLabel2';\r\n\t\t\tlabel2 = '2';\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tdescription += 'passing 1 undefined param & 2';\r\n\t\t\tlocalizedString = 'myTestLabel2';\r\n\t\t\toverride = true;\r\n\t\t\tcount = 0;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tlet formattedString;\r\n\tif (label2 != undefined || override) {\r\n\t\tformattedString = String.format(L(localizedString), '1', label2);\r\n\t} else {\r\n\t\tformattedString = String.format(L(localizedString), '1');\r\n\t}\r\n\r\n\talert(`${description} param(s) passed\\n--\\n${formattedString}`);\r\n}\r\n\r\n$.index.open();\r\n{code}\r\n\r\nYou will notice that every odd case has a problem. Ideally case 1 should not output the @. Here is what they look like:\r\n\r\ncase 1:\r\nActual: \"My test 1, test same param %1$@\"\r\nExpected: \"My test 1, test same param 1\"\r\ncase 2:\r\nActual: \"My test 1, test same param 2\"\r\nExpected: \"My test 1, test same param 2\"\r\ncase 3:\r\nActual: \"My test 1, test same param %1$@\"\r\nExpected: \"My test 1, test same param 1\"\r\ncase 4:\r\nActual: \"My test 1, test same param 2\"\r\nExpected: \"My test 1, test same param 2\"\r\ncase 5:\r\nActual: \"My test 1\"\r\nExpected: \"My test 1, test same param 1\"\r\n", "attachment": [ { "id": "66944", "filename": "app.tss", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-13T18:48:16.000+0000", "size": 780, "mimeType": "application/octet-stream" }, { "id": "67190", "filename": "IMG_1113.PNG", "author": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-25T23:17:31.000+0000", "size": 39981, "mimeType": "image/png" }, { "id": "66859", "filename": "index.js", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T14:50:15.000+0000", "size": 1074, "mimeType": "text/javascript" }, { "id": "66943", "filename": "index.tss", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-13T18:48:11.000+0000", "size": 155, "mimeType": "application/octet-stream" }, { "id": "66942", "filename": "index.xml", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-13T18:48:05.000+0000", "size": 114, "mimeType": "text/xml" }, { "id": "66860", "filename": "strings.xml", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-08-20T14:50:15.000+0000", "size": 188, "mimeType": "text/xml" } ], "flagged": false, "summary": "Localization Format bug", "creator": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS Simulator\r\n8.0.0\r\nLocalization", "comment": { "comments": [ { "id": "451295", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please send the index.xml and index.tss file here. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2019-09-11T16:16:05.000+0000", "updated": "2019-09-11T16:16:17.000+0000" }, { "id": "451368", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I added them", "updateAuthor": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-13T18:49:38.000+0000", "updated": "2019-09-13T18:49:38.000+0000" }, { "id": "451679", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello [~josh.mocek],\r\nAre you using 8.2.0.GA?", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-09-29T08:44:29.000+0000", "updated": "2019-09-29T08:44:29.000+0000" }, { "id": "451701", "author": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This was on 8.0.0GA", "updateAuthor": { "name": "josh.mocek", "key": "josh.mocek", "displayName": "josh.mocek", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-30T14:04:03.000+0000", "updated": "2019-09-30T14:04:03.000+0000" }, { "id": "451840", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~josh.mocek],\r\nCan you please test this issue on 8.2.0.GA and let us know the results?", "updateAuthor": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-10-04T06:59:32.000+0000", "updated": "2019-10-04T06:59:32.000+0000" }, { "id": "453313", "author": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks for reaching. I can't reproduce this issue. Rather I got only this \"My test 1, test same param 1\" line. See the below output and image: \r\n{code}\r\n[WARN] My test 1, test same param 1\r\n[WARN] My test 1, test same param 1\r\n[WARN] My test 1, test same param 1\r\n[WARN] My test 1, test same param 1\r\n{code}\r\n !IMG_1113.PNG|thumbnail! \r\n\r\nMy test environment was: \r\n{code}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.14.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\n\r\nNode.js\r\n Node.js Version = 8.9.4\r\n npm Version = 6.5.0\r\n\r\nTitanium CLI\r\n CLI Version = 5.2.2\r\n\r\nTitanium SDK\r\n SDK Version = 8.3.0.GA\r\n Target Platform = iphone 5S\r\n\r\n[INFO] Building using iOS SDK: 13.2\r\n{code}", "updateAuthor": { "name": "rislam", "key": "rislam", "displayName": "Riduanul Islam", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-25T23:19:29.000+0000", "updated": "2019-12-25T23:19:29.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }