Built-in localization for GridView filter shows OS language

14 posts, 0 answers
  1. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 24 Feb Link to this post

    Hello.

    I'm using a RadGridView element whose columns have filtering enabled. I want to use the built-in localization to localize the filter popup window. I have english and german as supported cultures in the csproj file and english as the neutral language in the assembly information.

    I can't manage to set the filter popup window in english, even though I set the currentCulture and currentUICulture parameters in Thread.CurrentThread to english before the InitializeComponents() method is even called. It looks like the RadGridView is showing the my OS language, which is german, but the language attribute of the RadGridView element is set to english. I've tried both with IsLocalizationLanguageRespected set to true and false and none seem to work. When I remove german as a supported language, that is, I remove "de" from the SupportedLanguages parameter in the csproj file, I get it in english, so the english built-in localization must be there, it just doesn't show up as long as german is enabled.

    I would like to know why the RadGridView filter window is not following the currentCulture language, nor the language parameter of RadGridView. Thanks in advance.

  2. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 24 Feb Link to this post

    Hi Carlos,

    Please verify that you are using the approach from this help article. Then you can try to set the Language based on the CurrentCulture as demonstrated in this troubleshooting article.

    Regards,
    Yoan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 24 Feb Link to this post

    Hi Yoan.

    Thank you for the fast reply. I have everything set in my project as it is in the page where the link you post lead, except for this Libs folder in the solution explorer. I don't have the telerik dll assemblies there but in the References folder with all the others (it's a grey folder). In this reference folder I don't have any dll for telerik resources (which is the one it's generated for the built-in localization I suppose), but when I look into the generated files after building the whole project, the assemblies are there in the language folders where they are meant to be, in this case the "de" folder. There is no "en" folder, it is never generated, and it's like this in all telerik programs I've made. I guess that's completely normal since it's the default language.
    I have then three questions:

    - Why are in this indications the assemblies so arranged (inside a lib folder)?

    - Why are the resources dlls in this lib folder (in my caseTelerik.Windows.Controls.resources.dll) if they are supposed to be generated when building the project?

    - How do I have to set up my solution, and/or my project, to follow the instructions from the page you sent the link to? That is, to have the assemblies arranged like that.

  5. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 25 Feb Link to this post

    Hello Carlos,

    I believe that this is not the problem since your RadGridView is localized correctly and only the filtering control has a problem. Please correct me if I am wrong.

    What comes to my mind is that there was a bug with the current culture of the filtering control, which is already fixed. Can you confirm that you are suing our latest official version - 2016.1.217? If not, may I ask you to test it?

    As for your questions about the structure of the SL application and the satellite assemblies, I would suggest you check this and this MSDN articles.

    Regards,
    Yoan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 25 Feb Link to this post

    Hi. I just tested if the RadGridView is correctly localized by enabling the GroupPanel, and the message that appears is still in German, both with the IsLocalizationLanguageRespected parameter set to true and false, so I'm afraid the grid view is not localized either, although this call:

    MessageBox.Show(MyGridView.Language.IetfLanguageTag);

    shows en, en-GB, or any other culture I set in the application CurrentCulture. So both the language parameter of the grid view and the culture of the application are correctly set, but the message appears in english only if German is not an available language. There must be a reason why the OS language is shown with preference over the application or grid view language.

    I checked the version I'm using and it's exactly 2016.1.217.1050.

    Please let me know what the problem can be, and of course if I should do other tests.

  7. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 26 Feb Link to this post

    Hello again.

    Are there any suggestions concerning this issue? Please tell me whether you have an idea of what may be causing this or if you need more information to know that is happening. Thanks again.

    Kind regards,

    Carlos

  8. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 29 Feb Link to this post

    Hello Carlos,

    I've tried to test your scenario, but, unfortunately, I was not able to. As it turns out, I was not able to change my CurrentUICulure, although I had changed all settings related to the culture and the region of my system (from Control Panel). Can you please try to structure the dlls and the satellite assemblies as shown in the help article? You can use the attached sample project.

    Please let me know about the result.

    Regards,
    Yoan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  9. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 01 Mar Link to this post

    Hello Yoan,

    I've downloaded and compiled the example that you've justa attached and as soon as I add the german resource asembly to the project (in a 'de' folder, just as it is done for spanish) the language for the grid view turns to german.

    I've checked the csproj file and in this part

    <ItemGroup>
        <Content Include="Libs\de\Telerik.Windows.Controls.resources.dll" />
        <Content Include="Libs\es\Telerik.Windows.Controls.resources.dll" />
        <Content Include="Libs\Telerik.Windows.Controls.dll" />
        <Content Include="Libs\Telerik.Windows.Controls.GridView.dll" />
        <Content Include="Libs\Telerik.Windows.Controls.Input.dll" />
        <Content Include="Libs\Telerik.Windows.Controls.Navigation.dll" />
        <Content Include="Libs\Telerik.Windows.Data.dll" />
        <Content Include="Libs\Telerik.Windows.Controls.Data.dll" />
        <Content Include="resources.es.dll" />
      </ItemGroup>

    I remove the content include for german, and delete the generated files in the 'de' folder inside de 'bin' folder, as well as removing the 'de' folder in the project directory (removing it in the visual studio project doesn't suffice), and then I compile it and it is en english, since it doesn't generate the telerik resource dll for german in the bin directory. Even compiling and after that removing the german resource dll from telerik is not enough, it is still shown in german, so I don't really know which dll file is the grid view using...

    To test, I've installed mozilla firefox in english to see if it's retrieving the language from the browser, but it's still shown in german, which leads me to the conclusion that it is actually showing the language of the OS.

    Is there any way to force the telerik control to overlook the OS language and take the current culture of the application?

    Thanks for trying to test it yourself.

     

  10. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 02 Mar Link to this post

    Hi,

    I believe that the sample project works in this way - it uses the current OS language, since as you stated, after running it the GridView was translated into German. On my side, it does not work at the same way. Although, I have changed my OS setting to be Spanish, the GridView uses the English version. After changing the region/language setting of my OS, I've checked the Thread.CurrentUICulture property and it shows "En". It seems that you can not change the CurrentUICulture -
    this is done when your OS is installed for the first time. So, I believe that the current language is respected on your side. May I ask you to check this property - Thread.CurrentUICulture? Also, you can try setting the IsLocalizationLanguageRespected  to False in my sample project to check if the Current language is not respected. 

    Regards,
    Yoan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  11. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 02 Mar Link to this post

    Hello Yoan,

    I just checked what you asked. Both the Thread.CurrentThread.CurrentCulture and the Thread.CurrentThread.CurrentUICulture are set to 'en'. To do so, I wrote in the "Do something 1" button (in Button1_Click) the following line:

    MessageBox.Show("CurrentCulture : " + Thread.CurrentThread.CurrentCulture.Name + "\n" +
                "CurrentUICulture : " + Thread.CurrentThread.CurrentUICulture.Name);

    I set both parameters in Application_Startup, before the this.RootVisual = new MainPage(); so the culture should already be in english before any graphic element is loaded.

    In any case, the grid view's behaviour is always the same, both the grid view and the filter are shown in german.

    I checked the IsLocalizationLanguageRespected in the grid view. It was set to true. I've set it to false but the result is the same, still in german. There must be another reason why the grid view is always resorting to german (the OS culture) as the first localization option.
    To be sure we have the program the same way configured, I will explain exactly how I have it. All I did to the one you've posted is to add 'de' in the SupportedCultures in the csproj file, and add a 'de' folder next to the 'es' one where I added the Telerik.Windows.Controls.resources.dll from the path Telerik\UI for Silverlight Q1 2016\Binaries\Silverlight\de. After that I compiled the program, I didn't do anything else except for adding now the code Messagebox.Show in button1. It's important to note that I am now building the project without the 'de' folder in the solution explorer in Visual Studio, but the german resources dll is always loaded in the bin/de folder as long as it's present, even though it doesn't belong to the solution itself. If I remove it from the bin/de folder, the grid view is still in german, so this is not the source where the grid view is taking the german strings from.

    In case it is of any importance, I'm using Visual Studio 2010 Premium, version 10.0.40219.1 SP1 Rel.

  12. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 02 Mar Link to this post

    I forgot to say that I've also tried building the project with the Neutral Language parameter (Project->Properties->Silverlight->Assembly Information) set to "none" as it was when you sent it, and to "English" also. Both produce the same result.
  13. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 04 Mar Link to this post

    Hello,

    Unfortunately, we can hardly guess what is the problem, since we are not able to reproduce it locally. However, please check the global assembly cache (GAC) for german resources. Since the runtime first checks the global assembly cache for an assembly matching the requested culture for your application. Please check this article.

    You can also try the approach from this stackoverlfow thread.

    You can test the MS DataGrid. Do you get the same result?

    Regards,
    Yoan
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  14. Carlos
    Carlos avatar
    8 posts
    Member since:
    Nov 2014

    Posted 04 Mar Link to this post

    I tried another thing with the application. If I change the CurrentUICulture and CurrentCulture to spanish, the radgridview turns to spanish. So the only language I can't set the RadGridView is english, which is the default one. It seems to me that the control tries to look for the resources for english, and since it can't find specific ones because there are no specific resources for english, it just uses others. If I try to set french for example without having it set as an available language, it turns to german, which is the OS language and it's available. If I remove the OS language from the available languages, that is, I remove german, then it turns to english if I try with french or english. So english only comes out as the last option, only when the specified language is not found and the OS language is not found either. So, trying it to english, the priority is the following:

    1-Specific english resources (they only exist as default language).

    2-OS language specific resources.

    3-Default language (english).

    So it seems to me like the default language is not considered from the telerik control as english, but as a last resort if the first and second options for the searched language are not fulfilled. Therefore, if it looks for the english resources, it can't find them, since the english language resources are not considered as such, but only as default. Do you know what the reason for this can be? I must set somehow english as the language for the default resources (setting the neutral language as english in the assembly information doesn't change the behaviour). Is there a Telerik.Windows.Controls.resources.dll for english language? If so, where can I find it?

    On the other hand, could you specify me how the global assembly cache should be configured? I couldn't find any telerik resources in the directories for the GAC, both with the explorer and with the Global Assembly Cache tool (Gacutil.exe).
    I checked the approach from stack overflow and I don't understand it too well. In the Xaml code posted there, where is this object declared into? Anyway, I'm not too sure if the question posed there fits my case, since I don't have trouble changing the current culture of the aplication, that works completely fine, the problem is how the resources are retrieved.

    I would really appreciate you clarifying me these aspects. Thank you for your time.

    Kind regards,

    Carlos Pérez

  15. Yoan
    Admin
    Yoan avatar
    1066 posts

    Posted 09 Mar Link to this post

    Hello Carlos,

    We do not have a separate satellite assembly for English. May I ask you to send the sample project which is not working. We want to check its configuration.

    Checking the GAC was only a blind guess, so I don't believe that it is the problem, since you had already checked it.

    Here are some other tests that you can try:

    1. Please replace our RadGridView with the MS DataGrid, to see if there is a difference.

    2. Please test the same case with other control from Telerik UI for Silverlight.  In this case we will verify that the problem is not in RadGridView only.

    3. You can try to localize your application by using other approach:
    1. Using Custom Localization Manager
    2. Localization Using ResourceManager

    More information about how to use these methods can be found in this help article. I hope some of them will help you. 

    Regards,
    Yoan
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
DevCraft banner