Localization in RichTextBox

2 posts, 0 answers
  1. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 06 Apr 2012 Link to this post

    I am using the rich text box to display a long legal disclaimer that requires a lot of different formats and also contains links in it.  Because of this my text box consists of many span and hyperlink tags.  Because our product is international I need to localize.  Unfortunately it appears that the only way a span tag accepts text is to have it statically placed at design time which obviously will not work for me.  I have tried multiple things:

    1.  Text={Binding Converter={StaticResource LabelConverter},ConverterParameter=KEY}
      this does not work because text does not allow binding.

    I have tried other stuff as well but since Span is not dependency object none of it has worked.  I also tried your suggestion in the documentation about extending your LocalizationManager but span does not allow attachment of resource key either.  Is there something else I should do here or is span not really useful unless I have static design time text?  Is there another approach I should take besides span?
  2. Iva Toteva
    Iva Toteva avatar
    1319 posts

    Posted 09 Apr 2012 Link to this post

    Hi Jason,

    The localization of RadRichTextBox concerns only the pop-ups that RadRichTextBox uses to apply formatting to the document and the messages that are shown in some cases.

    The content of the document cannot be localized, as it is normally created after the application is run and can be changed afterwards. Furthermore, spans are created, merged and split on the fly, depending on the formatting of the document in a way the user cannot control.

    What you can do is to create translated versions of your document and load the respective one when the current culture changes. In case the document will be mostly the same, you can use the same template and add merge fields to it. Again, when the current culture changes, you can assign different ItemsSource to the MailMergeDataSource in order to achieve your goal.

    I hope this helps.

    Kind regards,
    Iva Toteva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top