{ "id": "78707", "key": "TIMOB-4881", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": null, "resolutiondate": null, "created": "2011-08-03T09:57:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "cb-tooling", "i18n", "locale", "localization" ], "versions": [], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2018-08-01T23:10:31.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "I have just started using the i18N localisation features, and feel that there is a sorely needed feature which is to have a default locale.\r\n\r\nI realise you can get a default value by simply using the hints, but I feel this is an inadequate solution because it means you still have to embed your default text inside your standard JS code/view files, something I am trying to avoid.\r\n\r\nWhat I propose should happen is that there should be a folder/file structure like this:\r\n/i18n/strings.xml (or possibly i18n/default/strings.xml)\r\n/i18n/en/strings.xml\r\n/i18n/es/strings.xml\r\n\r\nThen when you call L('my_key') it will default to the value in the default strings.xml if there is no match on locale. This solution is far more elegant than the current solution where you have to pass in a hint.\r\n\r\nIn the mean time, I am building a simple workaround solution which uses JSON with a default JSON file instead.\r\n\r\nMatt", "attachment": [], "flagged": false, "summary": "Request for default i18n strings file", "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": "All environments\r\nTitanium Mobile SDK 1.7.2+ (not currently implemented in this version or lower versions)", "closedSprints": [ { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 }, { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 }, { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 }, { "id": 1050, "state": "closed", "name": "2018 Sprint 14 SDK", "startDate": "2018-07-01T18:40:57.193Z", "endDate": "2018-07-15T18:40:00.000Z", "completeDate": "2018-07-16T03:27:08.720Z", "originBoardId": 114 }, { "id": 1035, "state": "closed", "name": "2018 Sprint 11 SDK", "startDate": "2018-05-20T20:57:43.542Z", "endDate": "2018-06-03T20:57:00.000Z", "completeDate": "2018-06-04T15:13:14.425Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 }, { "id": 1039, "state": "closed", "name": "2018 Sprint 12 SDK", "startDate": "2018-06-03T15:22:23.401Z", "endDate": "2018-06-17T15:22:00.000Z", "completeDate": "2018-06-18T20:45:36.363Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "161753", "author": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For those of you that are interested, I have created a library for my workaround solution so that others can use it. It's based entirely on JSON, it's way more flexible than the Titanium solution, and it supports sensible defaulting without hints.\r\n\r\nhttps://github.com/mattheworiordan/json.i18n-for-Titanium-Mobile. \r\n\r\nPlease use it and provide feedback / contribute.", "updateAuthor": { "name": "matthew.oriordan", "key": "matthew.oriordan", "displayName": "Matthew O'Riordan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-03T13:31:39.000+0000", "updated": "2011-08-03T13:31:39.000+0000" }, { "id": "171727", "author": { "name": "gavincoop", "key": "gavincoop", "displayName": "Gavin Cooper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Any ideas on when this will be implemented?", "updateAuthor": { "name": "gavincoop", "key": "gavincoop", "displayName": "Gavin Cooper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-07T08:12:43.000+0000", "updated": "2011-11-07T08:12:43.000+0000" }, { "id": "188742", "author": { "name": "netrival", "key": "netrival", "displayName": "glenn losentes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Matthew, is your workaround solution works on SDK v1.8.xx? It seems not to work on my Android Emulator.\r\n", "updateAuthor": { "name": "netrival", "key": "netrival", "displayName": "glenn losentes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T21:51:16.000+0000", "updated": "2012-03-26T21:51:16.000+0000" }, { "id": "292111", "author": { "name": "warchild", "key": "warchild", "displayName": "Dário Marcelino", "active": true, "timeZone": "Europe/London" }, "body": "@Ingo, is it possible to re-prioritise this? This is an old shortcoming in Titanium and a default strings.xml file would make developer's life much easier. Please check the below 3 year old thread where this has been discussed:\r\nhttps://developer.appcelerator.com/question/121180/localization-with-i18n---default-language\r\n\r\nCurrent behaviour is defaulting the language to english but that is not always the best choice.\r\n\r\nThanks,\r\nDário", "updateAuthor": { "name": "warchild", "key": "warchild", "displayName": "Dário Marcelino", "active": true, "timeZone": "Europe/London" }, "created": "2014-02-10T00:38:54.000+0000", "updated": "2014-02-10T00:49:59.000+0000" }, { "id": "292126", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-02-10T07:09:56.000+0000", "updated": "2014-02-10T07:09:56.000+0000" }, { "id": "292143", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We'll take a look. Thanks!", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-10T16:39:09.000+0000", "updated": "2014-02-10T16:39:09.000+0000" }, { "id": "292298", "author": { "name": "warchild", "key": "warchild", "displayName": "Dário Marcelino", "active": true, "timeZone": "Europe/London" }, "body": "@Ingo, thank you.\r\n\r\n@Fokke, unfortunately my issue is with Android. For iOS I used the workaround of creating an \"aa\" locale. When the locale is not matched iOS uses the first in alphabetical order.\r\n\r\nFor android, I've tried explicitly creating a platform/android/res/values/strings.xml file but Titanium is either ignoring it or overwriting it with the en one. Frustrating...", "updateAuthor": { "name": "warchild", "key": "warchild", "displayName": "Dário Marcelino", "active": true, "timeZone": "Europe/London" }, "created": "2014-02-11T03:15:01.000+0000", "updated": "2014-02-11T03:15:01.000+0000" }, { "id": "302752", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~warchild], Titanium is overwriting it.\r\n\r\n[~ingo], This should be an easy fix. Just add a {{tiapp.xml}} option to determine which language should be used as the source for {{build/android/res/values/strings.xml}}", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-04-28T17:33:34.000+0000", "updated": "2014-04-28T17:33:34.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }