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

Windows: Implement Ti.Locale.setLanguage

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
      None
    • Environment:

      SDK 5.3.0.v20160418111755

    • Story Points:
      5
    • Sprint:
      2016 Sprint 10 SDK, 2016 Sprint 12 SDK

      Description

      Both iOS and Android supports Ti.Locale.setLanguage, however the function is not documented.

      Is it supposed to be supported or is it deprecated?

      Test code

      var win = Ti.UI.createWindow({ backgroundColor: 'green' });
      win.addEventListener('open', function () {
          Ti.Locale.setLanguage('en');
          Ti.API.info('current language is: ' + Ti.Locale.getCurrentLanguage());
          Ti.API.info('before change ' + L('this is my key'));
          Ti.Locale.setLanguage('en-GB');
          Ti.API.info('new language is: ' + Ti.Locale.getCurrentLanguage());
          Ti.API.info('after change ' + L('this is my key'));
      });
      win.open();
      

      i18n/en/strings.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <resources>
        <string name="this is my key">this is my value</string>
      </resources>
      

      i18n/en-GB/strings.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <resources>
        <string name="this is my key">this is my en-GB value</string>
      </resources>
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                jonasbjurhult Jonas Bjurhult
                Reviewer:
                Christopher Williams
              • Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code