Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14763] iOS: titleid and messageid properties don't work for AlertDialog

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-09-22T04:57:23.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/sRelease 6.1.0
ComponentsiOS
Labelsalert, alertDialog, ios
ReporterMatej
AssigneeHans Knöchel
Created2013-08-04T21:47:04.000+0000
Updated2016-11-17T19:01:00.000+0000

Description

titleid and messageid property doesn't work for alertDialog. *i18n/en/strings.xml*
 
<?xml version="1.0" encoding="UTF-8"?>
<resources>
	<string name="hello">Hello</string>
	<string name="world">world!</string>
</resources>
*app.js*
 
var win = Ti.UI.createWindow();

var alert = Ti.UI.createAlertDialog({
	titleid: "hello",
	messageid: "world"
});

console.log(L("hello") + " " + L("world"));

alert.show();
win.open();
*Docs* http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.AlertDialog-property-titleid

Comments

  1. Daniel Sefton 2013-08-05

    Tested and confirmed on iOS 6 simulator with Ti SDK 3.1.1 GA and 3.2 CI.
  2. carlo 2013-11-29

    Tested and confirmed on iOS 7.0.3 simulator with Ti SDK 3.1.3 GA
  3. Tim Poulsen 2014-02-14

    Tested with SDK 3.2.1.GA, Ti/CLI 3.2.1, iOS 7.0.3 simulator, Android 4.2.2. It works fine on Android. However, the properties do not work on iOS as reported.
  4. Rene Pot 2014-08-18

    titleid and messageid work fine on Android. However, buttonnames do not.
  5. Hans Knöchel 2016-09-14

    The problem was that the langConversationTable was not triggered from it's delegate, because the alert-dialog proxy extended the TiProxy and not TiViewProxy that has the method. PR: https://github.com/appcelerator/titanium_mobile/pull/8379 *Demo*: i18n/en/strings.xml
       <?xml version="1.0" encoding="UTF-8"?>
       <resources>
       	<string name="my_title">My Title</string>
       	<string name="my_message">My Message</string>		
       </resources>
       
    app.js
       var win = Ti.UI.createWindow({
           backgroundColor: "#fff"
       });
       
       var btn = Ti.UI.createButton({
           title: "Show alert"
       });
       
       var alertD = Ti.UI.createAlertDialog({
           titleid: "my_title",
           messageid: "my_message",
           buttonNames: ["Cancel", "Delete", "OK"], // Some non-localized elements as well
           cancel: 0,
           destructive: 1
       });
       
       alertD.addEventListener("click", function(e) {
           alert(e.index);
       });
       
       btn.addEventListener("click", function() {
           alertD.show();
       });
       
       win.add(btn);
       win.open();
       
  6. Chee Kiat Ng 2016-09-22

    CR and FT passed. PR merged.
  7. Harry Bryant 2016-11-17

    Verified as fixed, additionally tested with special characters. Tested On: iPhone 6 Plus 10.1.1 Device & Simulator iPhone 5S 9.3.5 Device Mac OS Sierra (10.12.1) Ti SDK: 6.1.0.v20161116071014 Appc Studio: 4.8.0.201611121409 Appc NPM: 4.2.8 App CLI: 6.1.0-14 Xcode 8.1 Node v4.4.7 *Closing ticket.*

JSON Source