summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-04-11 22:57:32 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2013-04-11 22:57:32 -0700
commit36fed4cb7c6bd164f42b41d3bbfa909e9ded183f (patch)
treea8ab7990c2ea0cdb642d0366a46292c7e92d3266 /src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
parent3348abf994f2abe5526454bef1a2194bba554e5c (diff)
parent5f99dec3f56da3e2b2e276c48d8836b5678bcb18 (diff)
downloadDotNetOpenAuth-36fed4cb7c6bd164f42b41d3bbfa909e9ded183f.zip
DotNetOpenAuth-36fed4cb7c6bd164f42b41d3bbfa909e9ded183f.tar.gz
DotNetOpenAuth-36fed4cb7c6bd164f42b41d3bbfa909e9ded183f.tar.bz2
Merge branch 'v4.2' into v4.3
Conflicts: src/version.txt
Diffstat (limited to 'src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs')
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
index af60596..d121e62 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
@@ -192,7 +192,7 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
}
/// <summary>
- /// Gets or sets a combination o the language and country of the user.
+ /// Gets or sets a combination of the language and country of the user.
/// </summary>
[XmlIgnore]
public CultureInfo Culture {
@@ -203,7 +203,16 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
if (!string.IsNullOrEmpty(this.Country)) {
cultureString += "-" + this.Country;
}
- this.culture = CultureInfo.GetCultureInfo(cultureString);
+
+ // language-country may not always form a recongized valid culture.
+ // For instance, a Google OpenID Provider can return a random combination
+ // of language and country based on user settings.
+ try {
+ this.culture = CultureInfo.GetCultureInfo(cultureString);
+ } catch (CultureNotFoundException) {
+ // Fallback to just reporting a culture based on language.
+ this.culture = CultureInfo.GetCultureInfo(this.Language);
+ }
}
return this.culture;