[SOLVED] Labels with attributes and internationalization

Author: gianni.sandigliano@unifacesolutions.com (gianni)

Hi Unifacers, I am in the process to convert a Uniface9 application to be multilanguage. All labels/buttons/messages should be converted to $text(SOMETHING). My issue is regarding labels including character attributes (bold / italic / underline); physically those labels are saved with sequences of 8 chars defining the attributes to be applied to the following (9th) character. An example: the string "CIAO" in bold is saved as: |c{U|1|1C|c{U|1|1I|c{U|1|1A|c{U|1|1O Possible combinations for these attributes are: |c{U|1|1 = Bold |b|!|1|1 = Italic |b{e|1|1 = Underline |c|!|1|1 = BoldItalic |b|1|1|1 = ItalicUnderline |c{e|1|1 = BoldUnderline |c|1|1|1 = BoldItalicUnderline If I directly move label content to USOURCE as a message, those specific sequences are threated as real character so that label does not mean anything for end user. As an alternative I can define 3 logical fonts to convert ONLY SINGLE attributes; an example: HyperLabel=Arial,Central European,8,underline BoldLabel=Arial,Central European,8,bold ItalicLabel=Arial,Central European,8,italic and map labels having only ONE attribute to these logical fonts. Unfortunately in many cases I am finding combinations of Bold+Underline; for CIAO in bold+underline is something like: |c{e|1|1C|c{e|1|1I|c{e|1|1A|c{e|1|1O AFAIK it is not possible to have a logical font with more than one font attribute, something like: BoldHyperLabel=Arial,Central European,8,bold+underline Any idea or hint? Thanks in advance for any suggestion. Regards, Gianni

5 Comments

  1. Hi Gianni, According to the doc the FontStyles setting can include "one or more styles, separated by spaces". E.g.

    BoldHyperLabel=Arial,Central European,8,bold underline For details see here. Hope this helps, Regards, Daniel


    Author: diseli (daniel.iseli@uniface.com)
  2. diseli said Hi Gianni, According to the doc the FontStyles setting can include "one or more styles, separated by spaces". E.g.

    BoldHyperLabel=Arial,Central European,8,bold underline For details see here. Hope this helps, Regards, Daniel  

    Thanks Daniel! I am giving it a try... Gianni P.S. Tested, IT WORKS! The only limitation remaining it is "only one attributes set" for a single label while originally more attributes set could be defined in a single label.


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  3. gianni said P.S. Tested, IT WORKS! The only limitation remaining it is "only one attributes set" for a single label while originally more attributes set could be defined in a single label.  

    Hi Gianni, If you use $bold, $italic, and/or $underline in the text of the message then it seems to work. This will of course only work with string substitution:

    %%$concat($bold("Hello"), " ", $italic("world"), "!")%%% Okay, this is probably not such a straightforward approach. Hope this helps. Daniel


    Author: diseli (daniel.iseli@uniface.com)
  4. diseli said
    gianni said P.S. Tested, IT WORKS! The only limitation remaining it is "only one attributes set" for a single label while originally more attributes set could be defined in a single label.  
    Hi Gianni, If you use $bold, $italic, and/or $underline in the text of the message then it seems to work. This will of course only work with string substitution:

    %%$concat($bold("Hello"), " ", $italic("world"), "!")%%% Okay, this is probably not such a straightforward approach. Hope this helps. Daniel  

    Yes...agreed. Anyhow building in short time a parser able to deal with all possible combinations is not a simple task and customer agreed to stay on the simple side. Thanks for your support! Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  5. Thanks, Gianni. And you are welcome. Daniel


    Author: diseli (daniel.iseli@uniface.com)