473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Which is best for storing strings: .resx or app.config?

Hi,

I've inherited an app that currently reads in hard-coded strings (like
error messages) from app.config.

It has been suggested that these would be better-placed in a .resx
file.

Is there any definitive thinking on this? Is there a most suitable
place that such strings should go?

Regards

Artie
Jan 23 '08 #1
4 4203
Hi Artie,

If you're looking at translating your application or those strings, I
would highly recommend using resx. If you make a user control or
window 'localizable', a new resx will be available for every language
you want to translate to (the mechanism falls back to the default
language if it can't find resx in other languages).

If the strings are actual 'settings' which the user should be able to
change, then perhaps a config might be more appropriate...

Regards,
Jeroen
Jan 23 '08 #2
On 23 Jan, 11:26, Jeroen <mercu...@gmail.comwrote:
Hi Artie,

If you're looking at translating your application or those strings, I
would highly recommend using resx. If you make a user control or
window 'localizable', a new resx will be available for every language
you want to translate to (the mechanism falls back to the default
language if it can't find resx in other languages).

If the strings are actual 'settings' which the user should be able to
change, then perhaps a config might be more appropriate...

Regards,
Jeroen
Thanks for your response Jeroen.

The application isn't intended to be translated for other languages.

This is purely to store messages that will be used in User Dialogs and
other strings on Forms.

We just need a good way of avoiding a rebuild if the User decides
they'd like to reword some of these strings at a later date.

Artie
Jan 23 '08 #3
In some cases it may be worth storing your configuraqtion data in a database
table, that way you can edit it without recompiling, It can make maintaining
a customers site a bit easier!

HTH

Guy

"Artie" wrote:
Hi,

I've inherited an app that currently reads in hard-coded strings (like
error messages) from app.config.

It has been suggested that these would be better-placed in a .resx
file.

Is there any definitive thinking on this? Is there a most suitable
place that such strings should go?

Regards

Artie
Jan 23 '08 #4
Hi,
Do a google search by .NET localization and read a couple of articles and
decide what is the best way around yuor problem.
If you are only going to translate in 1 or 2 languages keeping the way it's
may be probable faster than generating the infrastrcuture to support any
number of languages.

--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
"Artie" <ar********@yahoo.co.ukwrote in message
news:ba**********************************@l32g2000 hse.googlegroups.com...
Hi,

I've inherited an app that currently reads in hard-coded strings (like
error messages) from app.config.

It has been suggested that these would be better-placed in a .resx
file.

Is there any definitive thinking on this? Is there a most suitable
place that such strings should go?

Regards

Artie

Jan 23 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: pachyphloia | last post by:
hi all, how to read regular strings from a resx file? ResourceManager.GetString() returns @"first line\nsecond line" although "first line\nsecond line" is in a resx file. or is any string in a...
7
by: | last post by:
In the beginning we had Ini files. Later we had registery files. Now have xml files and our read-only myapp.config file. My question now, is what is the best way to store and load user and...
0
by: Robert Misiak | last post by:
Hi all- I'm trying to add Windows 98/ME support to an app that previously only supported Windows 2000+. My test box is a running 98 SE. I have a number of localized forms (translated for...
4
by: Phil Da Lick! | last post by:
Hello, Got strings.resx included in my assmebly as the default language neutral collection. ResourceManager res=new ResourceManager("strings", Assembly.GetExecutingAssembly()); string...
1
by: Ritu | last post by:
How to store connection strings in machine.config?What are the advantages of storing it in the machine.config file.Can u provide me with the information regarding accessibility of machine.config...
2
by: Paul | last post by:
I have plugged the ExceptionManagement app block into our framework and have a question about resource files. ExceptionManagerText.resx is one of resource files in the project. When you look at...
5
by: djc | last post by:
is it still customary to use web.config and global.asax to store connection strings? For example storing the string in web.config and using application start procedure in global.asax to declare a...
0
by: Johnny Kimble | last post by:
Hi all, I'm in a situation where I'd like to be able to programatically distiguish a standard resx file containing only strings from a WinForms resx file, that contains both strings and...
7
by: nws_reader | last post by:
I have a web service that needs to return a particular string for one of its web methods. I would like to manage the strings in a resource file. I went through a lot of the help provided on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.