resx

How can I embed C# assembly resources in the same assembly?

眉间皱痕 提交于 2019-12-05 20:12:49
I have added resources for different cultures to my Class Library Project. When building, seperate folders are created for each culture with an assembly in each of them. Is there a way to embed all the resources in the Class Library Assembly, instead of having an extra assembly for each culture? The class library is eventually used in another project, so with theses seperate folders, it need to distribute a zip file instead of just one assembly. Clarification: I was looking for a solution without installers or second party tools. Rather was I hoping for a solution inside Visual Studio where

Manually retrieve a resource value from a resx?

拥有回忆 提交于 2019-12-05 18:16:36
Is it at all possible to get the value from a resource file that is not set to the current user's culture? Our application is data-based opposed to culture-based. e.g. a document is a French document and specific labels and fields need to be updated and replaced with new data. Can the resource manager be instructed to use a French .resx instead of the default .resx? You can use the ResourceManager.GetString() method and provide the desired culture as a parameter: var culture = CultureInfo.CreateSpecificCulture("fr-FR"); var localizedString = ResourceManager.GetString("labelName", culture); you

On a deployed ASP.NET web site project, can I update a .resx file without recompiling?

≯℡__Kan透↙ 提交于 2019-12-05 17:16:33
I'm deploying an ASP.NET application to a locked down Production environment. Pushing assemblies (satellite resource assemblies included) into this environment has process associated with it, but copying non-assemblies to the environment does not. On an ASP.NET web site project, can I update a .resx file without recompiling? I guess it depends on what your app is doing with them. If you're pushing .resx files into the App_LocalResources folder of your website, they will be Just-In-Time compiled automatically as soon as you do that. So in this case you wouldn't have to recompile anything. No,

Generating Resx files for MVC

情到浓时终转凉″ 提交于 2019-12-05 15:37:34
We use resx files for globalization, along with database lookups for things that can be configured (such as tab names, which can be different by product) by our CS staff, and thus aren't known at design-time. I created a custom tool that reads resx files and intelligently dumps the key/value pairs into a relational database (matching values so we don't have duplicates). This has been a big help to our business - we don't have to send each resx for translation (and pay for duplicate translations of shared words) and we have a 'gold standard' with all our translations (in the database). The tool

Visual Studio 2010 doesn't generate Resource (Resx) designer code if file is localized

纵饮孤独 提交于 2019-12-05 15:04:46
问题 I've just come across the weirdest behavior in Visual Studio 2010 while working with Resx resource files and I just can't wrap my head around it. The problem is as follows: Visual Studio will not generate the designer.cs file for a resource file with a localized name (such as resource.fr.resx ), but it works fine for other files with simple names (such as resource.resx ). Here's a snapshot of my visual studio project setup: As you can see I just did a simple test with 3 resource files: test

Is there any .NET standard for dealing with localization yet allowing the users to customize the texts?

怎甘沉沦 提交于 2019-12-05 13:05:05
We're building an ASP.NET MVC application that is yet not localizable with a lot of Data Annotations DisplayAttribute with hard-coded strings and hard-coded message strings all over the code. Now we have a requirement that the application must be localizable, but still, we need to allow the users to customize the field displays and the texts. So far, I'm considering using RESX files with a custom IResourceProvider . Rick Strahl has written a good article about that . In this approach, the application is developed with standard RESX files, but in runtime, when the application need the strings,

asp.net global resources error 'The resource object with key '' was not found'

…衆ロ難τιáo~ 提交于 2019-12-05 07:44:40
I'm using asp.net global resource to try and implement a two language website, I added a simple resource in the global resource file called en-Us.resx that contains: Password | Text Email | Text then implemented it to a textbox within the default page: <asp:TextBox runat="server" ID="loginEmail" Text="<%$ Resources:en-US, Email %>" ></asp:TextBox> but when ever I run the page on localhost I get this error: The resource object with key '' was not found I am using asp.net 4.0, what is the problem? The format of resource files are ResourceName.culture.resx Create a resource file in the App

How do I publish/deploy an MVC Project with ResX Resources?

二次信任 提交于 2019-12-05 06:42:57
I have written a VERY simple MVC application which just displays a single string from a Resource file. It works just fine on my local machine but when I deploy the project to the web server I get the error. CS0103: The name 'Resources' does not exist in the current context You can very easily replicate exactly what I am doing in just 10 steps! Create a New MVC 2 Web Application. (File->New->Project->ASP.NET MVC 2 Web Application, say no to the Unit Testing Project) Add the "App_GlobalResources" folder. (right click the project and select Add->Add ASP.NET Folder->App_GlobalResources) Add a

Visual Studio creates invalid Resx files

旧巷老猫 提交于 2019-12-05 00:02:31
I have a pretty simple form that I am wanting to localize (I actually have quite a few in this project, they all have the same problem). When I set the form property Localizable to true Visual Studio generates a .resx file with the form name (as you would expect). The problem though is that it's adding all sorts of things to the .resx file that nothing else can open (eg WinRes, ResEx, Simple Resx Editor, RESX Editor etc). The error I get is: ResX file Type System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a the data at line 125, position 4

Adding new strings to resource.resx not reflecting into Designer.cs

非 Y 不嫁゛ 提交于 2019-12-04 22:22:32
I am adding two new strings to our resource.resx but these newly added resources(strings) are not reflecting into the auto-generated Designer.cs file. I have rebuilt the project and also tried clean+build the project but no luck! I have other resource files to support various international languages where also i need to these two new string resources Please suggest. Make sure the Custom tool property for your resx file is set to ResXFileCodeGenerator or PublicResXFileCodeGenerator . The .Designer.cs file should be regenerated every time you modify the resx file; if it's not, you can force it