Skip to content

Commit

Permalink
CLUNL.Localization 0.0.12.0
Browse files Browse the repository at this point in the history
Added a method to empty the string definitions.
  • Loading branch information
creeperlv committed Aug 24, 2022
1 parent 0abf87f commit 1700c0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CLUNL.Localization/CLUNL.Localization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Version>0.0.11.0</Version>
<Version>0.0.12.0</Version>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageProjectUrl>https://github.com/creeperlv/CLUNL</PackageProjectUrl>
<RepositoryUrl>https://github.com/creeperlv/CLUNL</RepositoryUrl>
Expand Down
7 changes: 7 additions & 0 deletions CLUNL.Localization/Language.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,5 +335,12 @@ public static string Find(string Key, string Fallback = "")
return Fallback;
else return LanguageStrings[Key].Replace("\\r", "\r");
}
/// <summary>
/// Remove loaded strings, hope to help reduce resource usage.
/// </summary>
public static void ClearLoadedStrings()
{
LanguageStrings.Clear();
}
}
}
7 changes: 7 additions & 0 deletions CLUNL.Localization/LanguageDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public void SaveToFile(FileInfo file)
}
}
/// <summary>
/// Clear the dictionary.
/// </summary>
public void Clear()
{
LanguageStrings.Clear();
}
/// <summary>
/// Load form string array.
/// </summary>
/// <param name="contents"></param>
Expand Down

0 comments on commit 1700c0c

Please sign in to comment.