diff --git a/src/FSharpSource.Profiles.targets b/src/FSharpSource.Profiles.targets index d56c1d703fd..274cbf5108d 100644 --- a/src/FSharpSource.Profiles.targets +++ b/src/FSharpSource.Profiles.targets @@ -3,7 +3,6 @@ - $(DefineConstants);PREFERRED_UI_LANG $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);BE_SECURITY_TRANSPARENT $(DefineConstants);FX_LCIDFROMCODEPAGE @@ -15,7 +14,6 @@ $(DefineConstants);FX_PORTABLE_OR_NETSTANDARD $(DefineConstants);NETSTANDARD1_6 - $(DefineConstants);PREFERRED_UI_LANG $(DefineConstants);FX_NO_APP_DOMAINS $(DefineConstants);FX_NO_ARRAY_LONG_LENGTH $(DefineConstants);FX_NO_BEGINEND_READWRITE diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index d95a68a394c..f53553fadbe 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2283,9 +2283,7 @@ type TcConfigBuilder = mutable optSettings : Optimizer.OptimizationSettings mutable emitTailcalls : bool mutable deterministic : bool -#if PREFERRED_UI_LANG mutable preferredUiLang: string option -#endif mutable lcid : int option mutable productNameForBannerText : string /// show the MS (c) notice, e.g. with help or fsi? @@ -2444,9 +2442,7 @@ type TcConfigBuilder = optSettings = Optimizer.OptimizationSettings.Defaults emitTailcalls = true deterministic = false -#if PREFERRED_UI_LANG preferredUiLang = None -#endif lcid = None // See bug 6071 for product banner spec productNameForBannerText = FSComp.SR.buildProductName(FSharpEnvironment.FSharpBannerVersion) @@ -2910,9 +2906,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.optSettings = data.optSettings member x.emitTailcalls = data.emitTailcalls member x.deterministic = data.deterministic -#if PREFERRED_UI_LANG member x.preferredUiLang = data.preferredUiLang -#endif member x.lcid = data.lcid member x.optsOn = data.optsOn member x.productNameForBannerText = data.productNameForBannerText diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index ad6a7f1648e..1d7d2b1f775 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -331,9 +331,7 @@ type TcConfigBuilder = mutable optSettings : Optimizer.OptimizationSettings mutable emitTailcalls: bool mutable deterministic: bool -#if PREFERRED_UI_LANG mutable preferredUiLang: string option -#endif mutable lcid : int option mutable productNameForBannerText: string mutable showBanner : bool @@ -481,11 +479,7 @@ type TcConfig = member optSettings : Optimizer.OptimizationSettings member emitTailcalls: bool member deterministic: bool -#if PREFERRED_UI_LANG member preferredUiLang: string option -#else - member lcid : int option -#endif member optsOn : bool member productNameForBannerText: string member showBanner : bool diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 1c78fd9aa33..7f9c71b633e 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -739,10 +739,8 @@ let codePageFlag (tcConfigB : TcConfigBuilder) = tcConfigB.inputCodePage <- Some(n)), None, Some (FSComp.SR.optsCodepage())) -#if PREFERRED_UI_LANG let preferredUiLang (tcConfigB: TcConfigBuilder) = CompilerOption("preferreduilang", tagString, OptionString (fun s -> tcConfigB.preferredUiLang <- Some(s)), None, Some(FSComp.SR.optsPreferredUiLang())) -#endif let utf8OutputFlag (tcConfigB: TcConfigBuilder) = CompilerOption("utf8output", tagNone, OptionUnit (fun () -> tcConfigB.utf8output <- true), None, @@ -771,9 +769,7 @@ let advancedFlagsBoth tcConfigB = [ yield codePageFlag tcConfigB yield utf8OutputFlag tcConfigB -#if PREFERRED_UI_LANG yield preferredUiLang tcConfigB -#endif yield fullPathsFlag tcConfigB yield libFlag tcConfigB yield CompilerOption("simpleresolution", @@ -849,11 +845,7 @@ let testFlag tcConfigB = let vsSpecificFlags (tcConfigB: TcConfigBuilder) = [ CompilerOption("vserrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.VSErrors), None, None) CompilerOption("validate-type-providers", tagNone, OptionUnit (id), None, None) // preserved for compatibility's sake, no longer has any effect -#if PREFERRED_UI_LANG CompilerOption("LCID", tagInt, OptionInt (fun _n -> ()), None, None) -#else - CompilerOption("LCID", tagInt, OptionInt (fun n -> tcConfigB.lcid <- Some(n)), None, None) -#endif CompilerOption("flaterrors", tagNone, OptionUnit (fun () -> tcConfigB.flatErrors <- true), None, None) CompilerOption("sqmsessionguid", tagNone, OptionString (fun s -> tcConfigB.sqmSessionGuid <- try System.Guid(s) |> Some with e -> None), None, None) CompilerOption("gccerrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.GccErrors), None, None) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index f6d7b4c6b8f..b355ac50c05 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -1635,7 +1635,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie let directoryBuildingFrom = Directory.GetCurrentDirectory() let setProcessThreadLocals tcConfigB = tcConfigB.openBinariesInMemory <- openBinariesInMemory -#if PREFERRED_UI_LANG match tcConfigB.preferredUiLang with #if FX_RESHAPED_GLOBALIZATION | Some s -> System.Globalization.CultureInfo.CurrentUICulture <- new System.Globalization.CultureInfo(s) @@ -1643,11 +1642,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie | Some s -> Thread.CurrentThread.CurrentUICulture <- new System.Globalization.CultureInfo(s) #endif | None -> () -#else - match tcConfigB.lcid with - | Some n -> Thread.CurrentThread.CurrentUICulture <- new CultureInfo(n) - | None -> () -#endif if tcConfigB.utf8output then Console.OutputEncoding <- Encoding.UTF8 diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 1fb69f2fc4b..b79e6924506 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2419,19 +2419,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i // We later switch to doing interaction-by-interaction processing on the "event loop" thread. let ctokStartup = AssumeCompilationThreadWithoutEvidence () -#if FX_LCIDFROMCODEPAGE - - // See Bug 735819 - let lcidFromCodePage = - if (Console.OutputEncoding.CodePage <> 65001) && - (Console.OutputEncoding.CodePage <> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) && - (Console.OutputEncoding.CodePage <> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) then - Thread.CurrentThread.CurrentUICulture <- new CultureInfo("en-US") - Some 1033 - else - None -#endif - let timeReporter = FsiTimeReporter(outWriter) #if !FX_RESHAPED_CONSOLE @@ -2494,19 +2481,14 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let fsiOptions = FsiCommandLineOptions(fsi, argv, tcConfigB, fsiConsoleOutput) let fsiConsolePrompt = FsiConsolePrompt(fsiOptions, fsiConsoleOutput) - // Check if we have a codepage from the console -#if FX_LCIDFROMCODEPAGE do - match fsiOptions.FsiLCID with - | Some _ -> () - | None -> tcConfigB.lcid <- lcidFromCodePage - - // Set the ui culture - do - match fsiOptions.FsiLCID with - | Some(n) -> Thread.CurrentThread.CurrentUICulture <- new CultureInfo(n) - | None -> () + match tcConfigB.preferredUiLang with +#if FX_RESHAPED_GLOBALIZATION + | Some s -> System.Globalization.CultureInfo.CurrentUICulture <- new System.Globalization.CultureInfo(s) +#else + | Some s -> Thread.CurrentThread.CurrentUICulture <- new System.Globalization.CultureInfo(s) #endif + | None -> () #if !FX_NO_SERVERCODEPAGES do diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index 56f9048f451..252bd099010 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -3277,16 +3277,9 @@ internal virtual BuildSubmission DoMSBuildSubmission(BuildKind buildKind, string projectInstance.SetProperty("UTFOutput", "true"); -#if FX_PREFERRED_UI_LANG // The CoreCLR build of FSC will use the CultureName since lcid doesn't apply very well // so that the errors reported by fsc.exe are in the right locale projectInstance.SetProperty("PREFERREDUILANG", System.Threading.Thread.CurrentThread.CurrentUICulture.Name); -#else - // When building, we need to set the flags for the fsc.exe that we spawned - // so that the errors reported by fsc.exe are in the right locale - projectInstance.SetProperty("LCID", System.Threading.Thread.CurrentThread.CurrentUICulture.LCID.ToString()); -#endif - this.BuildProject.ProjectCollection.HostServices.SetNodeAffinity(projectInstance.FullPath, NodeAffinity.InProc); BuildRequestData requestData = new BuildRequestData(projectInstance, targetsToBuild, this.BuildProject.ProjectCollection.HostServices, BuildRequestDataFlags.ReplaceExistingProjectInstance); submission = BuildManager.DefaultBuildManager.PendBuildRequest(requestData); diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index d0086462ab8..a3218473401 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -22,7 +22,6 @@ $(DefineConstants);CODE_ANALYSIS true v4.6 - $(DefineConstants);FX_PREFERRED_UI_LANG true