Built-in localization for de?

11 posts, 0 answers
  1. Björn
    Björn avatar
    23 posts
    Member since:
    Mar 2011

    Posted 20 Jul 2011 Link to this post

    I want to use the Built-in localization for German 'de'.

    I made following things according to localization-setting:
    - <SupportedCultures>de-CH</SupportedCultures>
    - startup:
        Thread.CurrentThread.CurrentCulture = new CultureInfo("de-CH");
        Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-CH");

    What's about the statement 'LocalizationManager.DefaultResourceManager = ES.ResourceManager' in the VB sample.
    It's missing in the C# sample. What's wrong there?

    When I opened the RadGridView -Filter it's still in English!
    Are the resources for RadGridView translated into German?

    Or I made something wrong?

    If the translations are missing: which controls are translated at the moment in which language?
    Can you send us the neutral language resx-file for the controls which are not translate at the moment.

    Thanks
    Björn.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 20 Jul 2011 Link to this post

    Hi Björn,

    Actually, the error is in the VB code. Thank you for pointing it out, it will be fixed immediately. The VB code will be appropriate in case you define your own resource and need to set the DefaultResourceManager. In your case it should not be necessary as the resources for the grid are localized in German.
    However, please make sure that the corresponding Folder - "de" is available in the folder with the binaries. Considering the keys for the string resources, you may find them here

    Greetings,
    Maya
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. Björn
    Björn avatar
    23 posts
    Member since:
    Mar 2011

    Posted 21 Jul 2011 Link to this post

    Hi Maya

    It's still not working.

    The Telerik.Windows.Controls.resources.dll is in the bin-Folder:
    ...\src\MyProject\bin\Debug\de
    But not in the xap-File:
    ...\src\MyProject.Web\ClientBin\MyProject.xap

    In the unzipped xap all the Telerik-dll's are there except the resources.dll one.

    Thanks
    Björn.
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 21 Jul 2011 Link to this post

    Hello Björn,

    I have tested again the issue and everything works as expected on my side. I am sending you a sample project illustrating the approach. Please take a look at it and let me know in case of any misunderstandings.

     

    Kind regards,
    Maya
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Björn
    Björn avatar
    23 posts
    Member since:
    Mar 2011

    Posted 22 Jul 2011 Link to this post

    Hi Maya
    Found the problem.
    According to the <SupportedCultures> configuration in the Silverlight-csproj file it will bind the resource-assemblies into the project.
    Because we want to support the swiss languages, we defined only de-CH, fr-CH, where we also define our own resources.
    But for these languages there are no resources from Telerik. So we have to define also the fallback languages de, fr - where resources from Telerik exists:
    <SupportedCultures>fr,de,fr-CH,de-CH</SupportedCultures>

    Maya - can you mark my reply as answer.

    That's it
    Björn.
  7. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 18 Nov 2011 Link to this post

    I would like to bring this question one step further: I have successfully managed to run the sample project where the text built into the GridControl is changed from English to German. But what about the column headers? What about the text on the buttons? How do I set text string in the XAML based on current language?

    Anne
  8. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Nov 2011 Link to this post

    Hi Anne Lyon,

    You need to have the string resources for the headers localized as well. Please take a look at our demos for a reference. As you can see the headers of the columns are translated in German as well. 


    All the best,
    Maya
    the Telerik team

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

  9. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 18 Nov 2011 Link to this post

    Thanks,
    Now at least I manage to get text from the language resource file to set text or content for other controls (labels, buttons etc.)
    One thing I don't understand is how to switch between the supported languages. In your demo you load some Telerik localization assemblies, but how do I load my private LanguageResources.resx file?
    I have read through your User Guide and it tells me to create files for each language:
    LanguageResources.en.resx
    LanguageResources.no.resx  (Norwegian)
    LanguageResources.resx
    where the last one gets the Access Modifier property set to Public.

    Now I can access resource strings in the bottom file when I run my solution.
    But if I want to switch to Norwegian? I have tried to set the no.resx file to Public, but the Designer.cs file that is generated is empty.
    I have also set the
    <SupportedCultures>en;no</SupportedCultures>
    in the project.
    But I do not manage to switch to my Norwegian resource file to display Norwegian text strings. Can you help?
  10. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 18 Nov 2011 Link to this post

    Hello Anne Lyon,

    Would you clarify a bit on the exact scenario that you want to accomplish ? Do you want to load your application with Norwegian localization or you want to change it run time ?
    Have you checked this article ?
     

    All the best,
    Maya
    the Telerik team

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

  11. Anne Lyon
    Anne Lyon avatar
    87 posts
    Member since:
    Jan 2010

    Posted 19 Nov 2011 Link to this post

    I have already done what is described in your article, but the point is I don't just want to translate the text "inside" the RadControls, but also the text on Buttons, Labels, Tooltip etc. So I need my own private Language file which contains also the keys and translations for all these other items.

    I want to build my app with English strings for my English customer, and I want to build my app with Norwegian strings for my Norwegian customer. I can only make my application use the strings from my LanguageResourses.resx file (which is in English) how do I load the file with Norwegian text, which is in the file LanguageResources.no.resx?

    I hoped that the only thing I needed to do was to set the language file I want to use (in my case LanguageResources.no.resx) to 'Public' and then this file would be used automatically when building, but it doesn't work as described in my previous post.

    I can of course rename the files so that the Language.Resources.resx file contains the language I want to build with, but what is then the point in having the other files with the other languages added to my solution?

    So, if we follow the steps in your Localization chapter in the User Guide, how do I load for instance the GridResources.nl.resx file rather than the GridResources.resx file when I build my project? I have set the SupportedCultures to 'en;nl' - but how do I make the builder load the dutch file instead of the default one?
  12. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 22 Nov 2011 Link to this post

    Hello Anne Lyon,

    You can specify the default resource manager as follows:

    //MainPage.xaml.cs
    public MainPage()
            {
                LocalizationManager.Manager = new LocalizationManager()
                {
                    ResourceManager = DE.ResourceManager,
                    Culture = new CultureInfo("de"),
                };
                InitializeComponent();     
            }
    OR
    //App.xaml.cs
    public App()
            {
                Thread.CurrentThread.CurrentCulture = new CultureInfo("de");
                Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");
     
     
                LocalizationManager.Manager = new LocalizationManager()
                {
                    ResourceManager = DE.ResourceManager,
                    Culture = new CultureInfo("de"),
                };
     
                this.Startup += this.Application_Startup;
                this.Exit += this.Application_Exit;
                this.UnhandledException += this.Application_UnhandledException;
     
                InitializeComponent();
            }

    In both cases DE is the name of the Resource file containing the localized string resources. Thus they will be loaded directly from it and not from the default one. Let me know if you need any further assistance with it.
    Furthermore, I would recommend you to run through this article for a reference that could be quite helpful when dealing with localizing Silverlight applications.
     

    Kind regards,
    Maya
    the Telerik team

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

Back to Top
DevCraft banner