Format arguments for IStringLocalizer do not support nullable reference types
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
The indexer of `this[string name, params object[] arguments]` of `IStringLocalizer` and the extension method `GetString(IStringLocalizer, String, Object[])` provided for `IStringLocalizer` do not support nullable format arguments.
### Expected Behavior
Nullable format arguments should be supported as they are also supported with `Format(string format, params object?[] args)` of `string`.
### Steps To Reproduce
Repro Project: https://github.com/dd-inno/stringlocalizer-format-issue
### Exceptions (if any)
_No response_
### .NET Version
6.0.400
### Anything else?
_No response_
Contributor guide
Research direction
Start by reading the IStringLocalizer indexer and its GetString extension method, then run the linked repro project to observe nullable format arguments. Compare their signatures with string.Format(string format, params object?[] args). Done means nullable arguments are accepted without nullable-reference-type warnings and the repro behaves as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- internationalization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100