Skip to content

Commit f01296d

Browse files
KevinRansombaronfel
authored andcommitted
Fix CompilerLocation strings (#9859)
1 parent 8d345ac commit f01296d

19 files changed

+230
-17
lines changed

fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
1414
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
1515
<DefineConstants>$(DefineConstants);NO_STRONG_NAMES</DefineConstants>
16-
<DefineConstants>$(DefineConstants);LOCALIZATION_FSCOMP</DefineConstants>
1716
<FsLexOutputFolder Condition="'$(TargetFramework)' != ''">$(TargetFramework)\</FsLexOutputFolder>
1817
<FsYaccOutputFolder Condition="'$(TargetFramework)' != ''">$(TargetFramework)\</FsYaccOutputFolder>
1918
<OtherFlags>$(OtherFlags) /warnon:1182</OtherFlags>
@@ -293,6 +292,7 @@
293292
<Compile Include="$(FSharpSourcesRoot)\fsharp\SimulatedMSBuildReferenceResolver.fs">
294293
<Link>ReferenceResolution/SimulatedMSBuildReferenceResolver.fs</Link>
295294
</Compile>
295+
<EmbeddedText Include="$(FSharpSourcesRoot)\utils\UtilsStrings.txt" />
296296
<Compile Include="$(FSharpSourcesRoot)/utils/CompilerLocationUtils.fs">
297297
<Link>CompilerLocation/CompilerLocationUtils.fs</Link>
298298
</Compile>

src/fsharp/CompileOps.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,8 +2418,7 @@ type TcConfigBuilder =
24182418
deterministic = false
24192419
preferredUiLang = None
24202420
lcid = None
2421-
// See bug 6071 for product banner spec
2422-
productNameForBannerText = FSComp.SR.buildProductName(FSharpEnvironment.FSharpBannerVersion)
2421+
productNameForBannerText = FSharpEnvironment.FSharpProductName
24232422
showBanner = true
24242423
showTimes = false
24252424
showLoadedAssemblies = false

src/fsharp/FSComp.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ tupleRequiredInAbstractMethod,"\nA tuple type is required for one or more argume
3434
203,buildInvalidWarningNumber,"Invalid warning number '%s'"
3535
204,buildInvalidVersionString,"Invalid version string '%s'"
3636
205,buildInvalidVersionFile,"Invalid version file '%s'"
37-
buildProductName,"Microsoft (R) F# Compiler version %s"
38-
buildProductNameCommunity,"F# Compiler for F# %s"
3937
206,buildProblemWithFilename,"Problem with filename '%s': %s"
4038
207,buildNoInputsSpecified,"No inputs specified"
4139
209,buildPdbRequiresDebug,"The '--pdb' option requires the '--debug' option to be used"
@@ -1493,7 +1491,6 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl
14931491
3351,chkFeatureNotRuntimeSupported,"Feature '%s' is not supported by target runtime."
14941492
3352,typrelInterfaceMemberNoMostSpecificImplementation,"Interface member '%s' does not have a most specific implementation."
14951493
useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)."
1496-
fSharpBannerVersion,"%s for F# %s"
14971494
optsLangVersion,"Display the allowed values for language version, specify language version such as 'latest' or 'preview'"
14981495
optsSupportedLangVersions,"Supported language versions:"
14991496
nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format."

src/fsharp/Microsoft.DotNet.DependencyManager/Microsoft.DotNet.DependencyManager.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222

2323
<ItemGroup>
2424
<EmbeddedText Include="DependencyManager.txt" />
25-
<Compile Include="$(FSharpSourcesRoot)\utils\CompilerLocationUtils.fs" />
25+
<EmbeddedText Include="..\..\utils\UtilsStrings.txt" />
26+
<Compile Include="..\..\utils\CompilerLocationUtils.fs" />
2627
<Compile Include="AssemblyResolveHandler.fsi" />
2728
<Compile Include="AssemblyResolveHandler.fs" />
28-
<Compile Include="$(FSharpSourcesRoot)\utils\CompilerLocationUtils.fs" />
2929
<Compile Include="NativeDllResolveHandler.fsi" />
3030
<Compile Include="NativeDllResolveHandler.fs" />
3131
<Compile Include="DependencyProvider.fsi" />

src/utils/CompilerLocationUtils.fs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@ open Microsoft.FSharp.Core
1515
module internal FSharpEnvironment =
1616

1717
/// The F# version reported in the banner
18-
#if LOCALIZATION_FSBUILD
19-
let FSharpBannerVersion = FSBuild.SR.fSharpBannerVersion(FSharp.BuildProperties.fsProductVersion, FSharp.BuildProperties.fsLanguageVersion)
20-
#else
21-
#if LOCALIZATION_FSCOMP
22-
let FSharpBannerVersion = FSComp.SR.fSharpBannerVersion(FSharp.BuildProperties.fsProductVersion, FSharp.BuildProperties.fsLanguageVersion)
23-
#else
24-
let FSharpBannerVersion = sprintf "%s for F# %s" (FSharp.BuildProperties.fsProductVersion) (FSharp.BuildProperties.fsLanguageVersion)
25-
#endif
26-
#endif
18+
let FSharpBannerVersion = UtilsStrings.SR.fSharpBannerVersion(FSharp.BuildProperties.fsProductVersion, FSharp.BuildProperties.fsLanguageVersion)
19+
20+
let FSharpProductName = UtilsStrings.SR.buildProductName(FSharpBannerVersion)
2721

2822
let versionOf<'t> =
2923
typeof<'t>.Assembly.GetName().Version.ToString()

src/utils/UtilsStrings.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
buildProductName,"Microsoft (R) F# Compiler version %s"
2+
fSharpBannerVersion,"%s for F# %s"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" source-language="en" target-language="cs" original="../UtilsStrings.resx">
4+
<body>
5+
<trans-unit id="buildProductName">
6+
<source>Microsoft (R) F# Compiler version {0}</source>
7+
<target state="new">Microsoft (R) F# Compiler version {0}</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="fSharpBannerVersion">
11+
<source>{0} for F# {1}</source>
12+
<target state="new">{0} for F# {1}</target>
13+
<note />
14+
</trans-unit>
15+
</body>
16+
</file>
17+
</xliff>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" source-language="en" target-language="de" original="../UtilsStrings.resx">
4+
<body>
5+
<trans-unit id="buildProductName">
6+
<source>Microsoft (R) F# Compiler version {0}</source>
7+
<target state="new">Microsoft (R) F# Compiler version {0}</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="fSharpBannerVersion">
11+
<source>{0} for F# {1}</source>
12+
<target state="new">{0} for F# {1}</target>
13+
<note />
14+
</trans-unit>
15+
</body>
16+
</file>
17+
</xliff>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" source-language="en" target-language="es" original="../UtilsStrings.resx">
4+
<body>
5+
<trans-unit id="buildProductName">
6+
<source>Microsoft (R) F# Compiler version {0}</source>
7+
<target state="new">Microsoft (R) F# Compiler version {0}</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="fSharpBannerVersion">
11+
<source>{0} for F# {1}</source>
12+
<target state="new">{0} for F# {1}</target>
13+
<note />
14+
</trans-unit>
15+
</body>
16+
</file>
17+
</xliff>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
3+
<file datatype="xml" source-language="en" target-language="fr" original="../UtilsStrings.resx">
4+
<body>
5+
<trans-unit id="buildProductName">
6+
<source>Microsoft (R) F# Compiler version {0}</source>
7+
<target state="new">Microsoft (R) F# Compiler version {0}</target>
8+
<note />
9+
</trans-unit>
10+
<trans-unit id="fSharpBannerVersion">
11+
<source>{0} for F# {1}</source>
12+
<target state="new">{0} for F# {1}</target>
13+
<note />
14+
</trans-unit>
15+
</body>
16+
</file>
17+
</xliff>

0 commit comments

Comments
 (0)