Solved

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

Posted on 2011-09-29
2
273 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

947 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

17 Experts available now in Live!

Get 1:1 Help Now