I’m developing a web service that needs to return results in both french and english. (Other languages may be added later.) The web service is written in C#.
I have separated all of the strings into a resource file. I was planning on adding a parameter to the service and setting the Thread.CurrentThread.CurrentCulture to the appropriate value. Then when I go to retrieve the correct string I check the CurrentCulture value.
Is this a good practice?
Rather than adding a parameter to every call in the service (or to whatever sort of webservice context you’ve got – it’s a while since I’ve done any WS stuff), have you thought of hosting the web service under different URLs to represent the different languages?
I’m not going to claim it’s a fabulous idea, but it has the benefit of being really simple 🙂 Seriously, I’m sure there will be lots of pros and cons, but it’s another thing to throw into the mix.