I'm using Independentsoft's Exchange WebDAV api. I'm trying to get a method signature like:
public string GetUsersLanguage(string username, string password){
//magic
//return fr-FR, or en-US, or nl-NL, etc
}
Exchange 2003 will configure the default folders (Inbox, Calendar, etc) to match the user's locale the first time the mailbox is accessed. So Inbox becomes Postvak IN for Dutch. I'd prefer not to inspect the top level folders and match that against a lookup table; is there another way?
The WebDAV api has a property getcontentlanguage that looks like it should contain the associated language for a mailbox (or at least a top level folder like Inbox), but whenever I query for that field Exchange returns a 404:
I was able to get something close, but not exactly what I'm looking for. Exchange 2003 OWA has a property spellingdictionarylanguage
that could contain a close approximation to the user's culture. I say could becuase this field if only set if the user has logged into OWA Premium (via IE in compatibility mode) and explicitly set the Spelling Dictionary.
Resource resource = new Resource(session);
var allProps = resource.GetProperties();
Console.WriteLine(
"Culture (Best Guess via Spelling Langauge): " +
allProps
.Where(x => x.Name == "spellingdictionarylanguage")
.Select(x => x.Value)
.FirstOrDefault() ?? "");
Hopefully there is still a better way to do this.