private static string PopulateMessage(string resource, string message, Match match, IReadOnlyDictionary <string, string> additionalReplacements) { // ToDo: load localized message from resource if (string.IsNullOrEmpty(message)) { return(null); } var replacements = match.Groups.Values.ToDictionary(g => g.Key, g => g.Value.ToString()); foreach (var pair in additionalReplacements) { replacements.Add(pair.Key, pair.Value); } return(PlaceholderHelper.ReplacePlaceholders( message, replacements)); }