web services - ServiceStack localized message text -


is there way set culture of error messages coming ss via incoming request client? can set culture of jsonservice client in fashion , have ss respond message text in culture.

yes, can set current culture per request in pre-request filter:

host.prerequestfilters.add((httpreq, httpresp) => {     thread.currentthread.currentuiculture = defaultculture;      if (httpreq.headers.allkeys.contains(httpheaderkeys.acceptlanguage))     {         var cinfo = new cultureinfo(httpreq.headers[httpheaderkeys.acceptlanguage]);         if (new resourcemanager(typeof(resourcefile)).getresourceset(cinfo, false, false) != null)             thread.currentthread.currentuiculture = cinfo;     } }); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -