By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,120 Members | 1,799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,120 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.