{ "id": "65690", "key": "TIMOB-4191", "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": [], "resolution": { "id": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T19:03:07.000+0000", "created": "2011-05-23T16:48:16.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "tbs-1.8.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-09T19:03:07.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "\n[Ti.Locale.getString()|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Locale.getString-method.html] produces an exception when ALL of the following conditions are present:\n\n* a underscores (or no-doubt other non-alphanumeric characters) are used in the key parameter, in the first argument of Ti.Locale.getString()\n* the hint argument of Ti.Locale.getString() is used\n* key does not exist in strings.xml\n\nThe following code demonstrates this:\n\n{code:lang=javascript|title=app.js}\nvar win1 = Ti.UI.createWindow({\n\tbackgroundColor:\"red\",\n\texitOnClose:true,\n\tnavBarHidden:false,\n\ttitle:\"Main Window\"\n});\n\nwin1.open();\n\nTi.API.info(L(\"info0\",\"No translation available for info0\")); // translation exists - produces correct translation\nTi.API.info(L(\"info_0\",\"No translation available for info_0\")); // translation exists - produces correct translation\nTi.API.info(L(\"info1\",\"No translation available for info1\")); // translation does not exist - produces hint message\nTi.API.info(L(\"info_1\",\"No translation available for info_1\")); // translation does not exist - produces exception followed by hint message\n{code}\n\n{code:lang=xml|title=i18n/en/strings.xml}\n\n\nHello0\nHello_0\n\n{code}\n\nThis results in the following output:\n\n{code:lang=none|title=logcat output}\n2364 TiAPI I (kroll$1: app://app.js) [198,597] Hello0\n 2364 TiAPI I (kroll$1: app://app.js) [2,599] Hello_0\n 2364 TiAPI I (kroll$1: app://app.js) [12,611] No translation available for info1\n 2364 ResourceType W Failure getting entry for 0x7f040002 (t=3 e=2) in package 0 (error -75)\n 2364 TitaniumModule E (kroll$1: app://app.js) [9,620] Exception trying to localize string 'info_1': \n 2364 TitaniumModule E android.content.res.Resources$NotFoundException: String resource ID #0x7f040002\n 2364 TitaniumModule E \tat android.content.res.Resources.getText(Resources.java:201)\n 2364 TitaniumModule E \tat android.content.res.Resources.getString(Resources.java:254)\n 2364 TitaniumModule E \tat android.content.Context.getString(Context.java:183)\n 2364 TitaniumModule E \tat ti.modules.titanium.TitaniumModule.localize(TitaniumModule.java:375)\n 2364 TitaniumModule E \tat ti.modules.titanium.TitaniumModuleBindingGen$8.invoke(TitaniumModuleBindingGen.java:379)\n 2364 TitaniumModule E \tat org.appcelerator.kroll.KrollProxy$ThisMethod.invoke(KrollProxy.java:397)\n 2364 TitaniumModule E \tat org.appcelerator.kroll.KrollMethod.call(KrollMethod.java:51)\n 2364 TitaniumModule E \tat org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1701)\n 2364 TitaniumModule E \tat org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)\n 2364 TitaniumModule E \tat org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)\n 2364 TitaniumModule E \tat org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)\n 2364 TitaniumModule E \tat org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)\n 2364 TitaniumModule E \tat org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)\n 2364 TitaniumModule E \tat org.mozilla.javascript.Context.evaluateReader(Context.java:1142)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.evaluateFile(KrollContext.java:105)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)\n 2364 TitaniumModule E \tat android.os.Handler.dispatchMessage(Handler.java:95)\n 2364 TitaniumModule E \tat android.os.Looper.loop(Looper.java:123)\n 2364 TitaniumModule E \tat org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)\n 2364 TiAPI I (kroll$1: app://app.js) [24,644] No translation available for info_1\n{code}", "attachment": [], "flagged": false, "summary": "Locale.getString() produces exception when underscore is used in key arg AND hint arg is used AND key does not exist in strings.xml", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Android SDK APIs 3.0\n* Titanium SDK version: 1.7.0 (05/18/11 14:33 187fe3f...)", "comment": { "comments": [ { "id": "161752", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "A nice workaround solution for this buggy XML based Localization in Titanium is at https://github.com/mattheworiordan/json.i18n-for-Titanium-Mobile. JSON based, and does not suffer from the same issues as the Titanium library.", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T13:30:35.000+0000", "updated": "2011-08-03T13:30:35.000+0000" }, { "id": "453555", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case.\r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T19:03:07.000+0000", "updated": "2020-01-09T19:03:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }