[ALOY-1009] Alloy: Add <Option> titleid so that it can use i18n strings
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-14T19:00:43.000+0000 |
Affected Version/s | Alloy 1.3.1 |
Fix Version/s | Alloy 1.4.0 |
Components | n/a |
Labels | n/a |
Reporter | Michael Gangolf |
Assignee | Tony Lukasavage |
Created | 2014-05-03T15:03:15.000+0000 |
Updated | 2014-06-22T13:21:09.000+0000 |
Description
<OptionDialog id="dialog" titleid="choose">
<!-- The Options tag sets the options property. -->
<Options>
<Option titleid="camera"></Option>
<Option titleid="gallery"></Option>
<Option titleid="cancel"></Option>
</Options>
</OptionDialog>
I am curious if you can simply use localization macro to define these strings instead of titleid.
you mean: that doesn't work. My workaround at the moment is to put this in my controller: $.dialog.options = [L("camera"), L("gallery"), L("cancel")]; and remove all options from the xml file. But I would like to define the optiondialog inside the xml or at least give the user the option to do it like all other elements like label, button and so on (the have titleid and textid)
Moving this improvement to engineering for further evaluation and prioritization.
Alloy likely won't support
titleid
on<Option>
until it is actually supported on the TitaniumOptionDialog.options
themselves. If you look at the [documentation for options](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.OptionDialog-property-options) they are only strings, that's it. With regards to that specific functionality, I would log a separate ticket targeted at Titanium mobile (not Alloy) for adding atitleid
property to the elements that you can pass toOptionDialog.options
. That said, I can implement what Ritu has suggested, meaning once implemented, your notation will look like this:Details
PR: https://github.com/appcelerator/alloy/pull/396 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-1009Functional Test
1. Run the test app for iOS 2. Click the screen 3. Assert that all 4 options in the resulting dialog say "Hello, World!", which confirms that they used the i18n localizations.Thanks for the quick fix! I'll create a different issue for titleid in mobile. But your fix already helps a lot!
Verified as working as expected. TiSDK 3.3.0.v20140516002513 Alloy 1.4.0-dev Appcelerator Studio 3.3.0.201405121247 CLI 3.3.0-dev Clsoing.