Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-23498

Windows: titleId/title should retain existing value if key not found

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
    • Story Points:
      5
    • Sprint:
      2016 Sprint 13 SDK

      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();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                cwilliams Christopher Williams
                Reviewer:
                Christopher Williams
              • Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-9812
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code