dotnet / dotnet/roslynator

Move string to a string resource file like Strings.resx/Strings.resx.cs

Open
#126 3 comments 1 reaction 0 assignees View on GitHub
Area-Refactorings Feature Request
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

What do you think about adding a refactoring option to move a hard-coded string to a `.resx` file?
For example:
`throw new ArgumentException("Invalid username.", nameof(username));`
Changes to:
`throw new ArgumentException(Strings.Invalidusername, nameof(username));`

Refactoring operation must add a Strings.resx file to project (if not exists) and generate required properties. Maybe user be able to select different `.resx` files from a list?

Do you think it's a good idea?

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating Roslynator's existing refactoring implementations and resource-generation handling, then define how a hard-coded string is selected, how a .resx file and properties are generated, and whether users can choose among resource files. Done would require an agreed scope and tests covering these behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.