¿Cómo debo escribir un controlador de excepciones internacionalizado [cerrado]

I want to internationalize my application. How should I write messages passed to my exception class constructor? I'd like to be able to configure only one file and it can be used for various international languages, like Chinese, French etc.

preguntado el 12 de junio de 12 a las 15:06

There is not much information in your question (e.g. what you mean by configure only one file is not clear), thus the downvotes. That said, you can look into string table resources en Windows y GNU obtener texto en otros sistemas. -

why the special question about exceptions? is there anything different you want to do, or have as constraints, than in the rest of your application? -

This question cannot be answered on Stack Overflow in its current form. We cannot teach you how to write code, or answer subjective questions like "what's the best X". What we can do is answer specific questions about actual problems you're having with code that you've written, once you have researched how to do this on your own and attempted to write it what you need. -

1 Respuestas

Exception handling shouldn't be internationalized. Internationalization should be in the display layer, once you've caught the exception, and passed the relevant information on for display. The string you pass up in the exception should just be a key, which is used internally to look up the message; additional information should be passed in separate fields in the exception.

Respondido el 12 de junio de 12 a las 15:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.