From 095b25f77fc56d17a213ba41a0a94f70a155f58c Mon Sep 17 00:00:00 2001 From: CWX Date: Sun, 19 Jan 2025 19:31:57 +0000 Subject: [PATCH] actually use string in replacements --- Libraries/Core/Services/I18nService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/Core/Services/I18nService.cs b/Libraries/Core/Services/I18nService.cs index a247c362..7e310aa6 100644 --- a/Libraries/Core/Services/I18nService.cs +++ b/Libraries/Core/Services/I18nService.cs @@ -96,13 +96,16 @@ public class I18nService { return rawLocalizedString; } + + var typeToCheck = args.GetType(); + var typeProps = typeToCheck.GetProperties(); foreach (var propertyInfo in args.GetType().GetProperties()) { var localizedName = $"{{{{{propertyInfo.GetJsonName()}}}}}"; if (rawLocalizedString.Contains(localizedName)) { - rawLocalizedString.Replace(localizedName, propertyInfo.GetValue(args, null)?.ToString() ?? string.Empty); + rawLocalizedString = rawLocalizedString.Replace(localizedName, propertyInfo.GetValue(args)?.ToString() ?? string.Empty); } } return rawLocalizedString;