actually use string in replacements

This commit is contained in:
CWX
2025-01-19 19:31:57 +00:00
parent a94d961313
commit 095b25f77f
+4 -1
View File
@@ -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;