4 Replies Latest reply on Aug 4, 2008 5:02 PM by justria

    Resizing localized controls

    justria Level 1
      I'd like to resize all controls after loading localized strings. Now, I load string and everything is too large or too small.

      Do we have a standard way to manage this task?

      Additionally, I use resources like this in e.g. labels:

      quote:

      @Resource(bundle='rStrings', key='createFirstClient')


      Thus, the UI designer in Flex looks pretty ugly, since it doesn't load actual values in the control under design, but the @Resource(..) stuff. Showing @Resource(..) in inspectors is OK, in UI designer preview it's kind of problematic.

      Thus, I wonder, if I should place special strings like

      quote:

      #rStrings.createFirstClient


      in labels and then load/replace localized strings during the open process of a window.

      Does a lib for this purpose exist? Or do I have to prepare a helper class myself.

        • 1. Re: Resizing localized controls
          Gregory Lafrance Level 6
          Don't use absolute layout. Always design your app from the start using Flex auto-layout capabilities.

          This means using percentages wherever possible and/or constraint based layout. Some areas might be able to use absolute positioning, if there is no localizable data, but even in that case you need to be absolutely sure the UI will not be affected when different translations are in place.

          Most software developers are absolutely ignorant on this point, believe me, I work in localization at Adobe and its true for the most part here. Even the UI designers are ignorant of the impact of localization on UI design.

          So you can ignore this advice and have a good time in the future maintaining your UI, or design it right from the git go with auto-layout and / or constraint based layout.
          • 2. Re: Resizing localized controls
            justria Level 1
            Thx Greg!

            quote:

            Originally posted by: Greg Lafrance
            Don't use absolute layout. Always design your app from the start using Flex auto-layout capabilities.


            I can't argue about this ;-) Thx for pointing out the right direction!

            quote:

            Originally posted by: Greg Lafrance
            Most software developers are absolutely ignorant on this point, believe me, I work in localization at Adobe and its true for the most part here. Even the UI designers are ignorant of the impact of localization on UI design.


            In fact, my other 'helper' apps were quite simple and strictly internal. Anyway, I migrated to container/constrained based layouts.

            quote:

            Originally posted by: Greg Lafrance
            So you can ignore this advice and have a good time in the future maintaining your UI, or design it right from the git go with auto-layout and / or constraint based layout.


            Since I prefer good software-design, nothing will ever be absolutely positioned.

            But then, this question comes up:

            I put several components in a HBox, which itself has 'lef/right constraints. Some of the inner controls are localizable string. What width should I set? No width at all?

            • 3. Re: Resizing localized controls
              Gregory Lafrance Level 6
              Just to confirm, the HBox has its left and right properties set, meaning it will be sized in relation to its parent container?

              It may depend on what type of components are inside the HBox. For Label, Button, and such, they should autosize based on their label. Text controls often should be 100%, but it really depends on your overall design, as many of the controls will interact.

              If you have simplified sample code to post to compile and run can check it out.
              • 4. Re: Resizing localized controls
                justria Level 1
                quote:

                Originally posted by: Greg Lafrance
                Just to confirm, the HBox has its left and right properties set, meaning it will be sized in relation to its parent container?



                Yes, that's how it is attached to its surrounding container's left and right.

                quote:

                Originally posted by: Greg Lafrance
                It may depend on what type of components are inside the HBox. For Label, Button, and such, they should autosize based on their label. Text controls often should be 100%, but it really depends on your overall design, as many of the controls will interact.



                OK, thx!