Remove the dead CultureMiddleware and centralize the supported-culture list
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 10
- Forks
- 0
- Avg merge
- 2h 52m
- Merged PRs (30d)
- 20
Description
Tier 3 — cleanup
Problem
CultureMiddleware implements full cookie + Accept-Language culture negotiation but is never registered — Program.cs uses UseRequestLocalization() instead, which does the same job. The dead middleware is a maintenance trap: the supported-culture list is now duplicated in three places that can silently drift apart.
Evidence
LearnStack/Middleware/CultureMiddleware.cs— never referenced inProgram.csLearnStack/Program.cs:85—app.UseRequestLocalization()- Duplicated culture lists:
Middleware/CultureMiddleware.cs:10,Controllers/CultureController.cs:10,Extensions/LocalizationExtensions.cs:7
Proposed fix
- Delete
CultureMiddleware.cs. - Expose one
SupportedCulturesconstant (inLocalizationExtensions) and reference it fromCultureController.
Acceptance criteria
- One source of truth for supported cultures
- Language switching still works via cookie and
Accept-Language
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LearnStack/Program.cs:85 and compare the culture lists in Middleware/CultureMiddleware.cs, Controllers/CultureController.cs, and Extensions/LocalizationExtensions.cs. Remove the unused middleware and centralize the list through LocalizationExtensions, then verify that cookie and Accept-Language language switching still work and only one supported-culture list remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, localization
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100