Switching between languages

7 posts, 1 answers
  1. Todd Millett
    Todd Millett avatar
    115 posts
    Member since:
    Jul 2009

    Posted 13 Apr 2011 Link to this post

    How can i switch between multiple languages at runtime. Do you have any sample for the same?
  2. Answer
    Andrew
    Admin
    Andrew avatar
    140 posts

    Posted 15 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 22 Aug 2011 Link to this post

    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 ?
  5. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 23 Aug 2011 Link to this post

    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.
  6. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 24 Aug 2011 Link to this post

    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 >>

  7. Tarun
    Tarun avatar
    32 posts
    Member since:
    Apr 2011

    Posted 24 Aug 2011 Link to this post

    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).
  8. Iva Toteva
    Admin
    Iva Toteva avatar
    1319 posts

    Posted 24 Aug 2011 Link to this post

    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 >>

Back to Top
DevCraft banner