This is a migrated thread and some comments may be shown as answers.

Localization in RichTextBox

1 Answer 80 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
jason
Top achievements
Rank 1
jason asked on 06 Apr 2012, 09:49 PM
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?

1 Answer, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 09 Apr 2012, 02:45 PM
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 >>

Tags
RichTextBox
Asked by
jason
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Share this question
or