{
"id": "159280",
"key": "TIMOB-23207",
"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": null,
"resolutiondate": null,
"created": "2016-04-04T07:55:38.000+0000",
"priority": {
"name": "Medium",
"id": "3"
},
"labels": [
"Android",
"Location"
],
"versions": [],
"issuelinks": [],
"assignee": null,
"updated": "2018-02-28T19:55:22.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": "10202",
"name": "Android",
"description": "Android Platform"
}
],
"description": "Steps to reproduce:\r\n\r\nCreate {{app/i18n/ru/app.xml}}\r\n\r\n{code:xml}\r\n\r\n Мое приложение\r\n\r\n{code}\r\n\r\nBuild app and look at the {{build/android/res/values-ru/strings.xml}}\r\nYou can find localized value {{app_neme}} there.\r\n\r\nIn {{app.js}} add {{Ti.API.warn(L(\"app_name\", \"I'm default value\"));}}\r\n\r\nYou can see: *I'm default value*\r\nBut must be: *Мое приложение*\r\n\r\nBut {{Ti.Locale.getString(\"app_name\");}} works as expected.\r\n\r\n",
"attachment": [],
"flagged": false,
"summary": "Android: Can't get localized app_name from L",
"creator": {
"name": "falko",
"key": "falko",
"displayName": "Andrey Tkachenko",
"active": true,
"timeZone": "Europe/Moscow"
},
"subtasks": [],
"reporter": {
"name": "falko",
"key": "falko",
"displayName": "Andrey Tkachenko",
"active": true,
"timeZone": "Europe/Moscow"
},
"environment": "Ti.SDK 5.1.2.GA, Genymotion emulator device 4.2.2",
"comment": {
"comments": [
{
"id": "381432",
"author": {
"name": "nsalahin",
"key": "nsalahin",
"displayName": "Nazmus Salahin",
"active": true,
"timeZone": "Asia/Dhaka"
},
"body": "Hello,\r\nI think the issue here is the language selected in your android phone. If the language in your android phone is not selected as Russian then \"L(\"app_name\", \"I'm default value\")\" will return the default value which happened in your case and I am able to reproduce also.\r\n\r\nI am actually able to get localized app name by doing the following steps.\r\n\r\n1. Selected the language of my android phone as English-Australian\r\n2. Created a default classic project for android.\r\n3. Created folder \"i18n/en-AU\" in the project folder.\r\n4. Created app.xml in that folder with following content.\r\n{code}\r\n\r\n\tAustralian APP\r\n\r\n{code}\r\n5. Replaced app.js code with following code.\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nwin1.open();\r\n\r\nTi.API.warn(L(\"app_name\", \"I'm default value\"));\r\n\r\n{code}\r\n6. Build and run the app.\r\n7. Got the following console log.\r\n{code}\r\n[WARN] : Australian APP\r\n{code}\r\n\r\n\r\n\r\n\r\n*Environment*:\r\n\r\n*Device info:* Nexux7 (android 6.0.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.2.0.GA and 5.2.1.GA\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.0\r\n*Appcelerator Studio:* 4.4.0.201511241829",
"updateAuthor": {
"name": "cng",
"key": "cng",
"displayName": "Chee Kiat Ng",
"active": false,
"timeZone": "America/Los_Angeles"
},
"created": "2016-04-04T09:32:10.000+0000",
"updated": "2016-04-14T01:50:44.000+0000"
},
{
"id": "382686",
"author": {
"name": "falko",
"key": "falko",
"displayName": "Andrey Tkachenko",
"active": true,
"timeZone": "Europe/Moscow"
},
"body": "But why Ti.Locale.getString(\"app_name\") and L(\"app_name\") has not identical value in my case?",
"updateAuthor": {
"name": "falko",
"key": "falko",
"displayName": "Andrey Tkachenko",
"active": true,
"timeZone": "Europe/Moscow"
},
"created": "2016-04-14T05:36:44.000+0000",
"updated": "2016-04-14T05:36:44.000+0000"
}
],
"maxResults": 2,
"total": 2,
"startAt": 0
}
}
}