diff --git a/external/Microsoft.SqlTools.Hosting.v2/Utility/CommandOptions.cs b/external/Microsoft.SqlTools.Hosting.v2/Utility/CommandOptions.cs index cdfdb568..106490bf 100644 --- a/external/Microsoft.SqlTools.Hosting.v2/Utility/CommandOptions.cs +++ b/external/Microsoft.SqlTools.Hosting.v2/Utility/CommandOptions.cs @@ -43,7 +43,7 @@ namespace Microsoft.SqlTools.Hosting.Utility { case "-autoflush-log": AutoFlushLog = true; - break; + break; case "-tracing-level": TracingLevel = args[++i]; break; @@ -150,6 +150,13 @@ namespace Microsoft.SqlTools.Hosting.Utility CultureInfo language = new CultureInfo(locale); Locale = locale; + // Allow the system set Number Format and Date Format to be preserved when changing the locale. + NumberFormatInfo NumberFormat = CultureInfo.CurrentCulture.NumberFormat; + DateTimeFormatInfo DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat; + + language.NumberFormat = NumberFormat; + language.DateTimeFormat = DateTimeFormat; + // Setting our language globally CultureInfo.CurrentCulture = language; CultureInfo.CurrentUICulture = language; diff --git a/src/Microsoft.SqlTools.Hosting/Utility/CommandOptions.cs b/src/Microsoft.SqlTools.Hosting/Utility/CommandOptions.cs index ee99604b..e7379edb 100644 --- a/src/Microsoft.SqlTools.Hosting/Utility/CommandOptions.cs +++ b/src/Microsoft.SqlTools.Hosting/Utility/CommandOptions.cs @@ -44,7 +44,7 @@ namespace Microsoft.SqlTools.Hosting.Utility { case "-autoflush-log": AutoFlushLog = true; - break; + break; case "-tracing-level": TracingLevel = args[++i]; break; @@ -155,6 +155,13 @@ namespace Microsoft.SqlTools.Hosting.Utility // Creating cultureInfo from our given locale CultureInfo language = new CultureInfo(locale); Locale = locale; + + // Allow the system set Number Format and Date Format to be preserved when changing the locale. + NumberFormatInfo NumberFormat = CultureInfo.CurrentCulture.NumberFormat; + DateTimeFormatInfo DateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat; + + language.NumberFormat = NumberFormat; + language.DateTimeFormat = DateTimeFormat; // Setting our language globally CultureInfo.CurrentCulture = language;