Localizing text in an exception.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray Cassick \(Home\)

    #1

    Localizing text in an exception.

    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?


  • Mihai N.

    #2
    Re: Localizing text in an exception.

    > Any opinions from the group on this one? Should I really care in this case[color=blue]
    > and take the time localize my exception strings into other languages?[/color]
    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.

    --
    Mihai
    -------------------------
    Replace _year_ with _ to get the real email

    Comment

    • David Levine

      #3
      Re: Localizing text in an exception.

      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.

      "Ray Cassick (Home)" <rcassickNOSPAM @enterprocity.c om> wrote in message
      news:OZSa1ZahEH A.3912@TK2MSFTN GP11.phx.gbl...[color=blue]
      > I am running the code for a code assembly through FXCop here and it seems[/color]
      to[color=blue]
      > 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[/color]
      that[color=blue]
      > 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[/color]
      used[color=blue]
      > 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?
      >
      >[/color]


      Comment

      Working...