Solved

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

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript to set controls visibility 5 34
VB.NET (2008) - Refactoring Question 2 21
encoding an href string 2 20
ASP.net File format issue in producing Excel file 3 32
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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