c# - How to show a localized exception message -


i need show exception message wcf service in localized language, different english. example, if run instruction anywhere in code:

throw new argumentnullexception(name, "el parámetro es obligatorio."); 

the result text "el parámetro es obligatorio. parameter name: xxxx" shown.

i need "parameter name" text translated spanish. think need modify thread culture, not sure how since wcf service.

if language depends on particular client, i'd create overload of functions of service additional parameter language, , set both currentculture , currentuiculture.

if language not depend on client (i.e. same language whole site), set somewhen during start. note new thread inherits language windows, not parent thread, hence have set again every freshly created thread (a newer version of .net framework allows overwrite behavior).

in case, make sure language pack framework installed.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -