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

Switching between languages

6 Answers 163 Views
SpellChecker
This is a migrated thread and some comments may be shown as answers.
Todd Millett
Top achievements
Rank 1
Todd Millett asked on 13 Apr 2011, 11:54 AM
How can i switch between multiple languages at runtime. Do you have any sample for the same?

6 Answers, 1 is accepted

Sort by
0
Accepted
Andrew
Telerik team
answered on 15 Apr 2011, 08:14 AM
Hi Todd Millett,

You can switch between languages in runtime by just setting the SpellCheckingCulture property of DocumentSpellChecker for the corresponding control. I have attached a demo showing you a simple example.

If you have other concerns do not hesitate to get back to us.

Greetings,
Andrew
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tarun
Top achievements
Rank 1
answered on 22 Aug 2011, 08:23 AM
Hi Andrew,

One of the telerik help site says that "ESDictionary class is located in another assembly and inherits RadDictionary"

http://www.telerik.com/help/silverlight/radspellchecker-multilanguage-support.html

Is it necessary that the custom dictionary class has to be in a separate assembly. Cant i have multiple dictionaries in the same assembly ? Even in your attached sample, you have two dictionaries, you have created two separate dictionaries in separate assemblies. Is that really required.

For me, i need to have 10 different cultures, so do i need to create 10 separate projects ?
0
Tarun
Top achievements
Rank 1
answered on 23 Aug 2011, 05:12 AM
Hi Andrew,

The sample application that you have attached indeed has the dictionaries...and we could see that the SpellCheckingCulture is also being set from code-behind (before firing the Check method).

But, whatever culture we specify, the suggestions provided by the spell checker for the same word are same in different culture also.

Where exactly can i figure out that the suggestions are different as per the culture specified.

Also, please let me know if there is a way to localize the SpellCheck buttons (Ignore All, Change, Add to dictionary, etc...) based on the current culture.

This is possible in asp.net version of the spellcheck control.
0
Iva Toteva
Telerik team
answered on 24 Aug 2011, 12:17 PM
Hi Tarun,

It is not necessary to create a different project for each dictionary. We have thought it would be convenient to keep them in separate projects, so that when the whole solution is built, different assemblies containing each dictionary will be prepared. Especially considering that some dictionaries can be quite big in size (for example, the Russian one is 13MB) and you might need different dictionaries in several unrelated applications. If you prefer, you can have all tdf files and the respective dictionary classes in one project.
As for the demo, it was prepared for a previous version of the controls. In the latest version we added an optimization for the use of MEF, so that only the assemblies that the control needs are loaded by default. In order to have MEF load all assemblies, including the assemblies with the Russian and German dictionaries from the example, you have to add the following line in the App.xaml.cs in the handler of the StartUp event:

private void Application_Startup(object sender, StartupEventArgs e)
{
    RadCompositionInitializer.Container = new CompositionContainer(new SafeXapCatalog());
     
    this.RootVisual = new MainPage();
}

When it comes to localization, it is supported and you can refer to this forum thread for the localization strings in question.

All the best,
Iva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Tarun
Top achievements
Rank 1
answered on 24 Aug 2011, 12:44 PM
Thanks Iva.

I was worried when same suggestions were appearing for different culture. But after adding the extra line in the App.xaml.cs, it is working fine.

You were talking about some optimization for the use of MEF. Can you please explain in which version has that been implemented.
Because without that extra line of code in the App.Xaml.cs, the attached sample does not provide correct suggestion (based on the selected Culture).
0
Iva Toteva
Telerik team
answered on 24 Aug 2011, 04:26 PM
Hello Tarun,

The change was made just after the Q1 SP1 (2011.1.419). So the project works correctly with the Q1 and Q1 SP1 version of the controls, but with Q2 (2011.2.712) and the internal builds after that, you need to add the line from the code-snippet before the InitializeComponent of the MainPage is invoked.

Greetings,
Iva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
SpellChecker
Asked by
Todd Millett
Top achievements
Rank 1
Answers by
Andrew
Telerik team
Tarun
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or