Project: titanium
Issue TIMOB-23498: Windows: titleId/title should retain existing value if key not found
Any of the UI proxies (subclasses of Ti.UI.View) that have *id properties for translation keys need to retain their existing translations/values if the newly set key can't be found. i.e. if we have a title of "Title" and set titled to 'key_that_wont_be_found', the title should stay 'Title' if no key could be found. Test case: {code:javascript} it('titleid', function () {	var bar = Ti.UI.createButton({	titleid: 'this_is_my_key'	});	should(bar.titleid).be.a.String;	should(bar.getTitleid).be.a.Function;	should(bar.titleid).eql('this_is_my_key');	should(bar.getTitleid()).eql('this_is_my_key');	should(bar.title).eql('this is my value');	bar.titleid = 'other text'; // key won't get found!	should(bar.titleid).eql('other text');	should(bar.getTitleid()).eql('other text');	should(bar.title).eql('this is my value'); // should retain old value if can't find key! Windows returns 'other text'	}); {code} *Classic app* {code} var win = Ti.UI.createWindow({ backgroundColor: 'green', layout: 'vertical' }), button = Ti.UI.createButton({ title: 'BUTTON TITLE', backgroundColor: 'blue' }); win.addEventListener('open', function () { button.titleid = "should_not_be_found"; Ti.API.info(button.title); // should print "BUTTON TITLE" }); win.open(); {code}
Story points: 5