namespace ChangeCulture
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://yoursite"))
{
try
{
using (SPWeb web = site.RootWeb)
{
ChangeCulture(web);
}
}
catch (Exception ex)
{
Console.WriteLine(string.Format("{0}:{1}","Error: ", ex.Message));
}
}
}
private static void ChangeCulture(SPWeb web)
{
if (web != null)
{
web.AllowUnsafeUpdates = true;
//Initialize CultureInfo
CultureInfo ci = new CultureInfo("en-US");
if (ci != null)
{
Console.WriteLine(string.Format("{0}{1}", "Processing ", web.Name));
web.Locale = ci;
web.Update();
}
web.AllowUnsafeUpdates = false;
}
if (web != null)
{
foreach (SPWeb _web in web.Webs)
{
ChangeCulture(_web);
}
}
}
}
}