Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ yarn-error.log
/DNN Platform/Tests/DotNetNuke.Tests.SourceGenerators/Snapshots/*.received.*
Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Pages/scripts/bundles/
Dnn.AdminExperience/Dnn.PersonaBar.Extensions/admin/personaBar/Dnn.Roles/scripts/bundles/
/DNN Platform/Library/DotNetNuke.Library.csproj
/DNN_Platform.sln
194 changes: 97 additions & 97 deletions DNN Platform/Library/DotNetNuke.Library.csproj
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootDirectory>$(MSBuildProjectDirectory)\..\..</RootDirectory>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<OutputPath>bin</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AssemblyName>DotNetNuke</AssemblyName>
<RootNamespace>DotNetNuke</RootNamespace>
<TargetFramework>net48</TargetFramework>
<Deterministic>true</Deterministic>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>CS0618,SA1600,CA5350,CA5351</WarningsNotAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" />
<PackageReference Include="AngleSharp.Css" />
<PackageReference Include="BouncyCastle.Cryptography" />
<PackageReference Include="HtmlSanitizer" />
<PackageReference Include="MailKit" />
<PackageReference Include="Microsoft.AspNet.WebPages" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Web.Infrastructure" />
<PackageReference Include="MimeKit" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="PetaPoco.Compiled" />
<PackageReference Include="Portable.BouncyCastle" />
<PackageReference Include="QuickIO.NET" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="StyleCop.Analyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
</ItemGroup>
<ItemGroup>
<Reference Include="DotNetNuke.WebControls">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Controls\DotNetNuke.WebControls\bin\DotNetNuke.WebControls.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\Components\Lucene.Net\bin\Lucene.Net.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net.Contrib.FastVectorHighlighter">
<HintPath>..\Components\Lucene.Net.Contrib\bin\Lucene.Net.Contrib.FastVectorHighlighter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Components\DataAccessBlock\bin\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DotNetNuke.Internal.SourceGenerators\DotNetNuke.Internal.SourceGenerators.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\Controls\CountryListBox\CountryListBox.csproj" />
<ProjectReference Include="..\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj" />
<ProjectReference Include="..\DotNetNuke.DependencyInjection\DotNetNuke.DependencyInjection.csproj" />
<ProjectReference Include="..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj" />
<ProjectReference Include="..\DotNetNuke.Log4net\DotNetNuke.Log4Net.csproj" />
<ProjectReference Include="..\DotNetNuke.Web.Client.ResourceManager\DotNetNuke.Web.Client.ResourceManager.csproj" />
<ProjectReference Include="..\DotNetNuke.Web.Client\DotNetNuke.Web.Client.csproj" />
<ProjectReference Include="..\DotNetNuke.WebUtility\DotNetNuke.WebUtility.vbproj" />
<ProjectReference Include="..\Syndication\DotNetNuke.Syndication.csproj" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<Compile Include="..\..\SolutionInfo.cs" Link="Properties\SolutionInfo.cs" />
</ItemGroup>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootDirectory>$(MSBuildProjectDirectory)\..\..</RootDirectory>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<OutputPath>bin</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AssemblyName>DotNetNuke</AssemblyName>
<RootNamespace>DotNetNuke</RootNamespace>
<TargetFramework>net48</TargetFramework>
<Deterministic>true</Deterministic>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>Recommended</AnalysisMode>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>CS0618,SA1600,CA5350,CA5351</WarningsNotAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AngleSharp" />
<PackageReference Include="AngleSharp.Css" />
<PackageReference Include="BouncyCastle.Cryptography" />
<PackageReference Include="HtmlSanitizer" />
<PackageReference Include="MailKit" />
<PackageReference Include="Microsoft.AspNet.WebPages" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Web.Infrastructure" />
<PackageReference Include="MimeKit" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="PetaPoco.Compiled" />
<PackageReference Include="Portable.BouncyCastle" />
<PackageReference Include="QuickIO.NET" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="StyleCop.Analyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Web" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
</ItemGroup>

<ItemGroup>
<Reference Include="DotNetNuke.WebControls">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Controls\DotNetNuke.WebControls\bin\DotNetNuke.WebControls.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\Components\Lucene.Net\bin\Lucene.Net.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net.Contrib.FastVectorHighlighter">
<HintPath>..\Components\Lucene.Net.Contrib\bin\Lucene.Net.Contrib.FastVectorHighlighter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Components\DataAccessBlock\bin\Microsoft.ApplicationBlocks.Data.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\DotNetNuke.Internal.SourceGenerators\DotNetNuke.Internal.SourceGenerators.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\Controls\CountryListBox\CountryListBox.csproj" />
<ProjectReference Include="..\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj" />
<ProjectReference Include="..\DotNetNuke.DependencyInjection\DotNetNuke.DependencyInjection.csproj" />
<ProjectReference Include="..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj" />
<ProjectReference Include="..\DotNetNuke.Log4net\DotNetNuke.Log4Net.csproj" />
<ProjectReference Include="..\DotNetNuke.Web.Client.ResourceManager\DotNetNuke.Web.Client.ResourceManager.csproj" />
<ProjectReference Include="..\DotNetNuke.Web.Client\DotNetNuke.Web.Client.csproj" />
<ProjectReference Include="..\DotNetNuke.WebUtility\DotNetNuke.WebUtility.vbproj" />
<ProjectReference Include="..\Syndication\DotNetNuke.Syndication.csproj" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="..\..\stylecop.json" Link="stylecop.json" />
<Compile Include="..\..\SolutionInfo.cs" Link="Properties\SolutionInfo.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public interface ILocalizationProvider

string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys);

string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys, out bool keyFound);

/// <summary>Saves a string to a resource file.</summary>
/// <param name="key">The key to save (e.g. "MyWidget.Text").</param>
/// <param name="value">The text value for the key.</param>
Expand Down
14 changes: 14 additions & 0 deletions DNN Platform/Library/Services/Localization/Localization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,20 @@ public static string GetString(string key, string resourceFileRoot, PortalSettin
return LocalizationProvider.Instance.GetString(key, resourceFileRoot, language, portalSettings, disableShowMissingKeys);
}

/// <overloads>One of six overloads.</overloads>
/// <summary>GetString gets the localized string corresponding to the <paramref name="key"/>.</summary>
/// <param name="key">The resource key to find.</param>
/// <param name="resourceFileRoot">The Local Resource root.</param>
/// <param name="portalSettings">The current portals Portal Settings.</param>
/// <param name="language">A specific language to lookup the string.</param>
/// <param name="disableShowMissingKeys">Disables the show missing keys flag.</param>
/// <param name="keyFound">Returns whether a ResourceKey exists in the ResourceFile.</param>
/// <returns>The localized Text.</returns>
public static string GetString(string key, string resourceFileRoot, PortalSettings portalSettings, string language, bool disableShowMissingKeys, out bool keyFound)
{
return LocalizationProvider.Instance.GetString(key, resourceFileRoot, language, portalSettings, disableShowMissingKeys, out keyFound);
}

/// <summary>GetStringUrl gets the localized string corresponding to the <paramref name="key"/>.</summary>
/// <param name="key">The resource key to find.</param>
/// <param name="resourceFileRoot">The Local Resource root.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public string GetString(string key, string resourceFileRoot, string language, Po

/// <inheritdoc/>
public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys)
{
return this.GetString(key, resourceFileRoot, language, portalSettings, disableShowMissingKeys, out _);
}

/// <inheritdoc/>
public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys, out bool keyFound)
{
// make the default translation property ".Text"
if (key.IndexOf(".", StringComparison.Ordinal) < 1)
Expand All @@ -67,7 +73,7 @@ public string GetString(string key, string resourceFileRoot, string language, Po
}

string resourceValue = Null.NullString;
bool keyFound = TryGetStringInternal(key, language, resourceFileRoot, portalSettings, ref resourceValue);
keyFound = TryGetStringInternal(key, language, resourceFileRoot, portalSettings, ref resourceValue);

// If the key can't be found then it doesn't exist in the Localization Resources
if (Localization.ShowMissingKeys && !disableShowMissingKeys)
Expand Down
Loading