Multilingual (French/German but extensible) RadMessageBox, RadTreeView, RadGridView, RadDock

10 posts, 0 answers
  1. Stephane Billes
    Stephane Billes avatar
    10 posts
    Member since:
    Feb 2010

    Posted 19 Feb 2010 Link to this post

    Requirements

    RadControls version

    2009.3.9.1203

    .NET version

    3.5 (should work in 2.0)

    Visual Studio version

    2008

    programming language

    C#


    PROJECT DESCRIPTION

    This project contains French and German localization providers for the Telerik RadMessageBox, RadDock, RadGridView and RadTreeView.
    The idea is to have a single localization provider that switches languages "automatically" to avoid having dirty code like "MessageBox.localization = new FrenchLocalization" for FR and so on for other languages!

    The demo project shows a RadGridView, a RadTreeView and some RadButtons for the RadMessageBox. The demo will allow you to switch between 3 differents languages (you can easily extend this model to use ResX files for lang to have many language support in your applications (I'm working on a 4 languages program).

    Usage: Put the following lines of code in the constructor of your form:

    //In the form constructor or in the Program.cs file  
     
    // Localize MessageBox  
    RadMessageLocalizationProvider.CurrentProvider = new TelerikLocalizations.RadMessageBoxLocalization();  
     
    // Localize TreeView  
    RadTreeViewLocalizationProvider.CurrentProvider = new TelerikLocalizations.RadTreeViewLocalization();  
     
    // Localize GridView  
    RadGridLocalizationProvider.CurrentProvider = new TelerikLocalizations.RadGridLocalization();  
     
    /*************/ 
    /*************/ 
    /*************/ 
     
    //Nothing more to use "current user windows language"  
    //To switch to french :  
    Application.CurrentCulture = new System.Globalization.CultureInfo("fr-FR");  
    //for german : de-DE, other languages would be like "nl-BE", "fr-BE", "en-US", ... 

    Hope this helps ^^
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 22 Feb 2010 Link to this post

    Hello Stephane Billes,

    Thank you for sharing your code project with the Telerik community.

    I am updating adding 2300 Telerik points to your account.

    Sincerely yours,
    Nikolay
    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. Stephane Billes
    Stephane Billes avatar
    10 posts
    Member since:
    Feb 2010

    Posted 22 Feb 2010 Link to this post

    Thanks for the points :o)
    Do you know if there are any plans to manage localizations "natively" in Telerik ? I may do the ResX stuff for our project but before doing it I prefer being sure you won't manage it :o)
  4. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 25 Feb 2010 Link to this post

    Hi Stephane Billes,

    Thank you for getting back to me.

    Currently, we do not have plans to change the method for localizing RadControls.

    If you have additional questions, feel free to contact me.

    Kind regards,
    Nikolay
    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.
  5. Stephane Billes
    Stephane Billes avatar
    10 posts
    Member since:
    Feb 2010

    Posted 25 Feb 2010 Link to this post

    Thanks Nikolay for quick response!
    I will implement the ResX stuff and share it here so users will *just* have to create there language ResX files to have translations for telerik controls (this would make adding new languages very easy and fast!).
    Small thing (but I may open a support ticket about this) : do you know if it's an issue or not that the "Culture" attribute of the localization providers is not correct ? (example when you implement "RadMessageLocalizationProvider" the Culture property is read-only and set to english, I didn't found a way to override its value....look in my code I had to use the "
    System.Globalization.CultureInfo.CurrentCulture.LCID" wich is not the best way to do it)
    Thanks,
             Stéphane
  6. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 03 Mar 2010 Link to this post

    Hello Stephane,

    The Culture value is correct for the default localization providers that we use, since they are in English. Please note that the Culture property is virtual and you can override it. However, this should happen in the LocalizationProvider descendant:
    public class RadMessageBoxLocalization : RadMessageLocalizationProvider
    {
        public override string GetLocalizedString(string id)
        {
            //Get localized string, if null use "base" texts (english)
            return RadLocalizationGeneric.GetRadMessageBoxLocalizedString(id) ?? base.GetLocalizedString(id);
        }
      
        public override System.Globalization.CultureInfo Culture
        {
            get
            {
                return CultureInfo.CreateSpecificCulture("de-DE");
            }
        }
    }


    Best wishes,
    Nikolay
    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.
  7. simone bartoccioni
    simone bartoccioni avatar
    17 posts
    Member since:
    Oct 2009

    Posted 21 Feb 2011 Link to this post

    Added Italian translation.

    Thanks!

    Simone
  8. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 23 Feb 2011 Link to this post

    Hello simone,

    Thank you for writing.

    We already have Italian localization providers uploaded by slear. You can find these localization providers here.

    You can update these localization providers according to the API of the latest RadControls for WinForms Q3 2010 SP1 and create a new Code Library thread uploading them. Should you decide to do so, your Telerik points will be updated accordingly.

    All the best,
    Nikolay
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. Anthony
    Anthony avatar
    24 posts
    Member since:
    Feb 2011

    Posted 27 Feb 2011 Link to this post

    Hello, is there any localization file available for RadGrid Web UI for German? I've already searched numerous post but unfortunately, I did not find one...

    - Mark
  10. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 28 Feb 2011 Link to this post

    Hi Anthony,

    There is are German localization resources available for the ASP.NET RadGrid. You can easily localize RadGrid for ASP.NET in any language by translating the default English Localization file. You will find the default localization files in the App_GlobalResources sub-folder in instalation folder of the controls. For example:
    C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q3 2010\App_GlobalResources
    There you will find RadGrid.Main.resx, which is the default English resource file. Copy this file to RadGrid.Main.de-DE.resx for Germany localization and translate string values in this file.

    Please refer to the following help topic for more information on how to do that:
    http://www.telerik.com/help/aspnet-ajax/localization-global-resources.html

    Best wishes,
    Vasil
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top