Pretty much the same as you did above, but don't commit the change to the database.
// If the user is registered, use their profile language setting.
if (CSContext.Current.User.IsAnonymous)
{
// logic to determine the language to use
CSContext.Current.User.Profile.Language = "en-us";
}
Now I'm sure you don't want