I am working on a large project which needs to support I18N. We are having a difficult time with exception messages that are displayed to the user. There seem to be a number of options available (this assumes checked exceptions and every layer wraps). It is assumed that low level exceptions like SQLExceptions do not need to be translated because they are never shown to the user they are just logged.
1. When the business layer catches an exception and wraps it, it should set the message of the new exception based on a resource bundle. The problem with this is that the business llayer then needs to have access to a resource bundle
2. Use the message of the exception as a key into a resource bundle and have the gui layer do the actual translation. The advantage is that only the gui deals with messages that the user sees.
3. Have the exception know how to localize itself (probably by setting some kind of key for a resource bundle). This is the most OO solution.
Any other suggestions/ideas?