1 Reply Latest reply on Jan 6, 2010 7:30 PM by GordonSmith

    <s:RichText> localization <content>

    KenichiM Level 1

      How do I add a localization text for <s:RichText>, where the text makes user of the formatting tags such as <s:p>, <s:span> etc.

       

      For example I have:

       

      <s:RichText width="200" content="{resourceManager.getObject('test','rich')}" />  // Also tried resourceManager.getString

       

      And in the resource bundle:

      rich=<s:p>We tried,<s:br/></s:p><s:p>Additionally, based on your situation, you are no longer eligible to have your fees deducted<s:span fontWeight="bold">We will need to collect a credit card payment from you next.</s:span></s:p>

       

      However when run, the rich text control displays the formatting tags as text.

        • 1. Re: <s:RichText> localization <content>
          GordonSmith Level 4

          The content property is intended only for use by the MXML compiler, to support writing TLF tags like

           

          <s:RichText width="200">

              <s:p>We tried...</s:p>

          </s:RichText>

           

          The content property does not support runtime parsing of a String containing some text markup language into a text object model, represented by a TextFlow, for use by RichText. In other words, RIchText is markup-language-agnostic; it only cares about TextFlow objects. So you have to do this runtime parsing (or "importing") step yourself.

           

          Try something like

           

          <s:RichText width="200" textFlow="{TextFlowUtil.importFromString(resourceManager.getString('test', 'rich')}"/>

           

          where the resource is

           

          rich=<p>We tried,<br/><p><p>Additionally, based on your situation, you are no longer eligible to have your fees deducted<span fontWeight="bold">We will need to collect a credit card payment from you next.<span><p>

           

          Gordon Smith

          Adobe Flex SDK Team