Localizing text in an exception.

  • Thread starter Thread starter Ray Cassick \(Home\)
  • Start date Start date
R

Ray Cassick \(Home\)

I am running the code for a code assembly through FXCop here and it seems to
be throwing a fit each time I pass in some descriptive text into the
constructor for various exceptions I am throwing.

FXCop says that I should be grabbing the text from a string resource so that
it can be localized based on the current culture info.

If this was text that was going to be displayed in a GUI that might be used
in a different country I might be worried about it but this is just
exception text most likely to only be seen by a developer.

Any opinions from the group on this one? Should I really care in this case
and take the time localize my exception strings into other languages?
 
Any opinions from the group on this one? Should I really care in this case
and take the time localize my exception strings into other languages?
Are you 100% sure no user will see it?
One option: use numbers. The message can be "Fatal exception 1234"
Just a sentence to localize, easy to report and find if a user will
ever see it.
 
It really depends on the app you are developing. If it's for in-house use,
or if you are absolutely, positively sure it will always be run in an
English-only culture then ignore FxCop. Otherwise, I'd at least get familiar
with using string resources, and ideally you would use resources to prepare
yourself for multiple cultures and for running with satellite assemblies.

One thing to keep in mind...even though you think the message will only be
seen by a developer the odds are high that it will be seen by everyone who
runs the product.
 
Back
Top