From b6643fa47322b4391c478dbbee4cbd2d9bb2220a Mon Sep 17 00:00:00 2001
From: Jojo-1000 <33495614+Jojo-1000@users.noreply.github.com>
Date: Fri, 23 Jun 2023 14:22:36 +0200
Subject: [PATCH] Add documentation comments for LocaleChange.
---
Duplicati/Library/Main/LocaleChange.cs | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/Duplicati/Library/Main/LocaleChange.cs b/Duplicati/Library/Main/LocaleChange.cs
index 5d3952b30..402d240e1 100644
--- a/Duplicati/Library/Main/LocaleChange.cs
+++ b/Duplicati/Library/Main/LocaleChange.cs
@@ -6,6 +6,10 @@ using System.Threading.Tasks;
namespace Duplicati.Library.Main
{
+ ///
+ /// Changes the current locale for all threads and for log messages in the current context.
+ /// When disposed the changes are reset.
+ ///
public class LocaleChange : IDisposable
{
private static readonly string LOGTAG = Logging.Log.LogTagFromType();
@@ -16,6 +20,9 @@ namespace Duplicati.Library.Main
private IDisposable m_localizationContext = null;
+ ///
+ /// Change locale if newLocale is not null
+ ///
public LocaleChange(System.Globalization.CultureInfo newLocale)
{
if (newLocale == null)
@@ -39,10 +46,24 @@ namespace Duplicati.Library.Main
}
}
+ ///
+ /// Change locale if ForcedLocale is specified in options
+ ///
+ /// Command line options
+ ///
+ /// Thrown if specified locale was not found.
+ ///
public LocaleChange(Options options)
: this(options.HasForcedLocale ? options.ForcedLocale : null)
{
}
+ ///
+ /// Change locale if 'force-locale' is specified in options dictionary
+ ///
+ /// Command line options
+ ///
+ /// Thrown if specified locale was not found.
+ ///
public LocaleChange(Dictionary options)
: this(new Options(options))
{