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

  • Thread starter Thread starter Artie
  • Start date Start date
A

Artie

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
 
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
 
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
 
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
 
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.
 
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 Machinhttp://www.laceupsolutions.com








- Show quoted text -

Thanks for your response Ignacio, but I'm not doing this for different
languages.

It's just to keep strings out of the code and in config files.

So far, it looks like the existing design (using app.config) is the
best, since it really only needs to store key-value pairs.

Thanks

Artie
 
Back
Top