Solved

asp.net resource files, do I need to set a default language?

Posted on 2011-09-29
2
272 Views
Last Modified: 2012-06-27
I need to add resource files to my application.  In most instances there will be only one verions.  I initially used riblet.rexs, but then started seeing errors in the log file that said it was looking for riblet.en-Us.resx.  Do I need to name my file this?  I realize that this is english.

My thought was to use the file with no language extension, then add files with language extensions only when it was necessary, for instance if I needed to add a french version.

In most cases the files will be language neutral and will just hold values that need to be changed without recompiling the code.
0
Comment
Question by:jackjohnson44
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 36862251
A neutral resource is compiled into the code. So you need to recompile the application to change a value.

A language specific resource can be changed without recompiling the application itself, but you need to recompile the resource. Not a lot better.

If you want values that need to be changed without recompiling, you need to save them as settings. There is a good presentation of how to use settings in ASP at the following site: http://aspalliance.com/820
0
 

Author Comment

by:jackjohnson44
ID: 36903644
Thanks.  I know how to deploy.  Everythign works.
If I try to access a file like below, I will get lines in the log file that say it can't find Riblet.en-US.resx.  It will still find the value and everythign works, but the log files fill up.

SPUtility.GetLocalizedString("$Resources:key", "Riblet", (uint)System.Threading.Thread.CurrentThread.CurrentCulture.LCID);

I want to optionally use additional languages only if I need them.  So if I want Riblet.fr.resx I can use it, if not it will default to the Riblet.rexs file.  I can get around the error by using Riblet.en-US.resx, but I don't want to also use Riblet.resx which would be an exact copy.

Again, the function call works, I just don't want the log file filling up.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Asp/Net Validation date Issue 9 38
Wpf develop 5 35
Create XML 5 34
Iterate a dictionnary to change values 4 30
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now