Hi,
I'm trying to localize my buiness object properties, with the Display Attribute.
Like this:
[Display(ResourceType = typeof(Business.BusinessResources), Name = "Text1")]
My Business.BusinessResources is in my Buisness Library. So I got a Business.dll, and a subfolder called "en" with my Business.resources.dll.
- BusinessResources.resx (Public modifier, embeddet resource, PublicResXFileCodeGenerator)
- BusinessResources.en.resx (Public modifier, embeddet resource, PublicResXFileCodeGenerator)
My problem is, that the english translation would't get called, when I set the CurrentCulture an CurrentUICulture to "en". I always get back my german translation.
Can anyone help me with this problem? What I'm doing wrong? Do you need mor information?
Thanks
Kevin
I am not sure, as I haven't tried to do this. However, the Display attribute is a standard DataAnnotations attribute, so I suspect there might be an MSDN article on the topic?
Thank you for your fast reply.
I googled it a long time. But can't find a capable topic or post.
But do you think that I'm on the right way? Have an supfolder called "en" which includes my Business.resources.dll.
Kevin
Usually when creating resource translations, you create all the language-specific resx files in the Resources folder of your project. Visual Studio will create subfolders with resource assemblies automatically when you build the project. You don't create those assemblies yourself - it is a result of the build process.
I'd just like to add a reference to http://resex.codeplex.com/ .
ResEx is the composite, translation friendly .NET Resource editor.
You'd still need to include the various language resources in your project but Resex makes it a lot easier to translate or find non-translated resources
Thank you guys. I tried to put my resx-Files into my project and the problem is still the same.
I also used the ResEx Editor, and it says that all my resx-Files are translated correctly.
If I have any further informations on this topic I will let u know.
Kevin
Is this rich client, or Asp.Net, WebForms or MVC?
I'm using WPF with .NET 4.
Found the problem...
It's because we load our modules (*.dll), which includes the XAML views and everything else, in a shell (the main exe). And the shell standard culture was set to de-DE. So if I set these culture to en, everything works fine.
Kind regards
Kevin
Copyright (c) Marimer LLC