Skip to content

Commit

Permalink
Add missing interpolation character
Browse files Browse the repository at this point in the history
This fixes unhelpful exception message, if localizable text cannot be found in the associated resource dictionary.
  • Loading branch information
marcinotorowski committed Feb 7, 2022
1 parent 9a54d78 commit 87316e9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private string GetLocalizedValue()
throw new ArgumentException($"Invalid resource type '{_type.FullName}'! {_type.Name} is not visible for the parser! Change resources 'Access Modifier' to 'Public'", _propertyName);
PropertyInfo propertyInfo = _type.GetProperty(_value, BindingFlags.Public | BindingFlags.GetProperty | BindingFlags.Static);
if (propertyInfo == null || !propertyInfo.CanRead || propertyInfo.PropertyType != typeof(string))
throw new ArgumentException("Invalid resource property name! Localized value: {_value}", _propertyName);
throw new ArgumentException($"Invalid resource property name! Localized value: {_value}", _propertyName);
_localizationPropertyInfo = propertyInfo;
}
return (string)_localizationPropertyInfo.GetValue(null, null);
Expand Down

0 comments on commit 87316e9

Please sign in to comment.