Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16600] Alloy: Cannot internationalize options of an OptionDialog

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelscb-tooling, defect
ReporterMatteo Landi
AssigneeUnknown
Created2014-03-02T10:30:27.000+0000
Updated2018-02-28T20:04:10.000+0000

Description

It seems like it is not possible to internationalize options while defining an OptionDialog using Alloy markup. I tried this:
        <OptionDialog id="end_ride_dialog" onClick="do_click_dialog" title="L('end_ride_dialog_title')" >
            <Options>
                <Option>L('end_ride_dialog_option_cancel')</Option>
                <Option>L('end_ride_dialog_option_arrived')</Option>
            </Options>
        </OptionDialog>
And this (mind the quotes):
        <OptionDialog id="end_ride_dialog" onClick="do_click_dialog" title="L('end_ride_dialog_title')" >
            <Options>
                <Option>"L('end_ride_dialog_option_cancel')"</Option>
                <Option>"L('end_ride_dialog_option_arrived')"</Option>
            </Options>
        </OptionDialog>
But the dialog keeps showing bare strings (i.e. L('end_ride_dialog_option_cancel')).

Attachments

FileDateSize
broken-option-dialog.tgz2014-03-05T20:36:02.000+0000636833

Comments

  1. Ritu Agrawal 2014-03-05

    We would appreciate if you can provide a simple but runnable test case to reproduce the issue. We want to make sure that we reproduce the same issue that you are running into.
  2. Matteo Landi 2014-03-05

    Please see the attached example. Let me know if you need anything else.
  3. Ritu Agrawal 2014-03-06

    Moving it to engineering as I can reproduce the issue with the provided test case. Same functionality works fine with the following Titanium test case.
       Ti.UI.setBackgroundColor('white');
       var win = Ti.UI.createWindow({
         title: 'Click window to test',
         backgroundColor: 'white',
         exitOnClose: true,
         fullscreen: false
       });
       
       var opts = {
         cancel: 2,
         options: [L('option1'), 'Help', 'Cancel'],
         selectedIndex: 2,
         destructive: 0,
         title: 'Delete File?'
       };
       
       win.addEventListener('click', function(e){
         var dialog = Ti.UI.createOptionDialog(opts).show();
       });
       win.open();
       
  4. Tim Poulsen 2014-03-10

    Moved to TIMOB since this can be reproduced using classic Titanium code. Possibly duplicates TIMOB-15376 also.

JSON Source