resx

.NET Custom Control Resources.resx

I have a C# custom control that loads images from Resources.resx. I was loading this resources into the Project's Resources and then accessing them like: ProjectNamespace.Properties.Resources.resourcename; This works for one project but now I want to use my control in multiple projects. What's the best way to handle this? Load th...

add png to resx

Hello out there! I need to add .png files and set them to embedded in a resx file programmatically. The .png file may or may not be already in the resx. Here's what I've tried. No errors occur when I run the code, but the file is not put into the .resx. Thanks very much for the help!! try { for (int i = 0; i < m_pngFileNames.Len...

Is there a way to override a specific resource value in .NET .resx file?

So i have: App_GlobalResources/MyApp.resx with a Name/Value pair of "Email" = "Email Address" In my application, is there a way to override this value? At some point in the application, I want to change the value of the Name/Value pair. "Email" = "Email Address" ... becomes... "Email" = "Contact Email Address" And have that referenc...

Asp.net Site Translation Tools?

I have a fairly large professional web application that has had parts of it translated already about a year ago but now needs to be taken to the next level with the whole thing done. There are over 1500 resx files. What I would really like is a tool that could let me edit all the resx files in a .net web application that can: Allow fo...

VS2008 designer automatically update control's property from resource file

I have a situation where some of the control's string property values are automatically replaced with a variable from a resource (.resx) file in the designer file during design time. For example, I have a form that contains a combobox. A snapshot of the code in the designer file may look something like this: this.comboDocument.Name = "...

Handle "Cannot access a closed resource set"

I have a website with several languages in a database. From the database I use ResXResourceWriter to create my .resx files. This is working really good but sometimes I get this exception: MESSAGE: Cannot access a closed resource set. SOURCE: mscorlib FORM: QUERYSTRING: TARGETSITE: System.Object GetObject(System.String, Boolean, Boolea...

Deploy ASP.NET app without .resx file?

I have an ASP.NET web application with a .resx file in App_GlobalResources whose resources are typically accessed like this: ASPX: <asp:Literal ID="l1" runat="server" Text="<%$ Resources:GalleryServerPro, Admin_Tab_Hdr %>" /> Code-behind: string msg = Resources.GalleryServerPro.Successfully_Restored_Msg; Is there any way to compile th...

DataAnnotations and Resources don't play nicely

I'm using dataannotations in an MVC2 app and am a little discouraged when trying to use RESX file resources for error messages. I've tried the following but keep getting the exception "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type" [Required(ErrorMess...

MVC Localization of Default Model Binder

Hi, I am currently trying to figure out how to localize the error messages generated by MVC. Let me use the default model binder as an example, so I can explain the problem. Assuming I have a form, where a user enters thier age. The user then enters "ten" in to the form, but instead of getting the expected error of "Age must be be...

Localization: How to allow the user to define custom resources without compiling?

In our application, we have a collection of data items, each with a DisplayedName property. This property should be localized, i.e. it should be displayed in the language selected by the user. Therefore, another property, DisplayedNameResourceKey, specifies which resource should be returned by the DisplayedName property. In simplified c...

Changes in resolving .resx in Visual Studio 2010?

Hi, I'm working on a quite simple Webpage (MVC2), using localisation based on ResourceFiles. I have the MVC2 Project and the Resources in a seperate Assembly. The Resources contains 3 languages (Resource.resx, Resource.de.resx, Resource.en.resx, Resource.ja.resx) and I'm querying them via the ResourceManager. Call from the .aspx ...

Pull dynamic string out of embedded RESX

I have a RESX resource file that I can retrieve the values out of using the strongly typed properties and assign to values in my Silverlight 3 app. However at runtime I need to generate the lookup key based on some values to avoid a ton of if/switch statements. I'm trying to use the ResourceManager, but it doesn't like .resx files. Sear...

Using SQL for localization instead of RESX files in ASP.NET

Hi, I'm thinking of developing the following but wondering if it already exists out there: I need a SQL based solution for assigning and managing localization text values for an asp.net site instead of using RESX files. This helps maintain text on the site without having to take it down for deployment whenever an update is required. T...

Is there a way to determine the culture info that a ComponentResourceManager is using when it gets instantiated in the designer?

I'm explicitly setting the CurrentThread.CurrentUICulture to french right before the Component Resource Manager is being called for my user-control, but the default values are being pulled for the controls, not the french values. Any ideas? ...

Generating Resource file from aspx page for selective attributes

Hi, I have an aspx page with lables and grids, I have to create a resource file out of it. When I use VS default resource file generation it created resource key for all attributes of all the controls. I want to create resorucekey of few controls only with and that to few attributes like only Text, ToolTip etc. Is there any way or third...

% style macros not supported in some C++/CLI project property pages under VS2010?

We're currently evaluating VS2010 and have upgraded our VS2008 C++/CLI project to the new .vcxproj format. I've noticed that a certain property we had set in the project settings did not get translated properly. Under Configuration Properties -> Managed Resources -> Resource Logical Name, we used to have (in VS2008) the setting: $(Int...

String resource file naming schemes and management

A trivial question perhaps, but I'm interested in the answers. I'm currently refactoring some very large monolithic string resource files (one dumpster resource file per project, in about 30 projects). I'm splitting them such that we follow a convention for our files and make the strings easier to find and manage when coding. Generally...

How can I extract the original image stream from a System.Drawing.Bitmap object?

I am embedding images into my assembly using .resx files. Upon runtime, I need to save the images into standalone files, restoring the original content. How can I extract the original file stream from an System.Drawing.Bitmap instance? I know I can create a stream using Bitmap.Save(), but this transcodes (and in effect - inflates) the im...

ASP.NET *.resx Serialization

I'm contributing on an I18N project and there's a call to serialize our *.resx files as JSON objects (for whatever reason). What I'm wondering is: Is there a way to get a list of all of the valid keys for a given *.resx file so that we could use HttpContext.GetGlobalResourceObject to grab the tokens? If that won't work, has anyone com...

Get values from *.resx files in XAML

Is it possible to add some value from resource file right into the XAML markup? Or for localization we always have to make something like this in *.cs file: txtMessage.Text = Messages.WarningUserMessage; Where Messages is resource, and txtMessage is TextBlock. ...