Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1009] Alloy: Add <Option> titleid so that it can use i18n strings

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-05-14T19:00:43.000+0000
Affected Version/sAlloy 1.3.1
Fix Version/sAlloy 1.4.0
Componentsn/a
Labelsn/a
ReporterMichael Gangolf
AssigneeTony Lukasavage
Created2014-05-03T15:03:15.000+0000
Updated2014-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>
already supports titleid but the actual

Comments

  1. Ritu Agrawal 2014-05-07

    I am curious if you can simply use localization macro to define these strings instead of titleid.
  2. Michael Gangolf 2014-05-07

    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)
  3. Ritu Agrawal 2014-05-09

    Moving this improvement to engineering for further evaluation and prioritization.
  4. Tony Lukasavage 2014-05-13

    Alloy likely won't support titleid on <Option> until it is actually supported on the Titanium OptionDialog.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 a titleid property to the elements that you can pass to OptionDialog.options. That said, I can implement what Ritu has suggested, meaning once implemented, your notation will look like this:
       <OptionDialog id="dialog" titleid="choose">
         <!-- The Options tag sets the options property. -->
         <Options>
           <Option>L('camera')</Option>
           <Option>L('gallery')</Option>
           <Option>L('cancel')</Option>
         </Options>
       </OptionDialog>
       
  5. Tony Lukasavage 2014-05-14

    Details

    PR: https://github.com/appcelerator/alloy/pull/396 test app: https://github.com/appcelerator/alloy/tree/master/test/apps/testing/ALOY-1009

    Functional 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.
  6. Michael Gangolf 2014-05-14

    Thanks for the quick fix! I'll create a different issue for titleid in mobile. But your fix already helps a lot!
  7. Federico Casali 2014-05-16

    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.

JSON Source