[TIMOB-23498] Windows: titleId/title should retain existing value if key not found
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-06-21T18:38:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | Windows |
Labels | parity |
Reporter | Christopher Williams |
Assignee | Kota Iguchi |
Created | 2016-06-10T19:39:02.000+0000 |
Updated | 2016-09-05T16:45:21.000+0000 |
Description
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:
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'
});
*Classic app*
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();
Do we have *id property other than
titleid/textid
? If so let's create new ticket for those. Changed ticket title to describe this ticket is fortitleid/textid
. PR: https://github.com/appcelerator/titanium_mobile_windows/pull/746Verified using: OS: Microsoft Windows 10 Pro 10.0.14393 Appc core: 6.0.0-38 Appc NPM: 4.2.8-6 Ti SDK: 6.0.0.v20160904203840 Lumia 930: 10.0 Lumia 520: 8.1 Original title is retained if the titleid does not exist Closing ticket