kasuken / kasuken/LearnStack

Remove the dead CultureMiddleware and centralize the supported-culture list

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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 registeredProgram.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 in Program.cs
  • LearnStack/Program.cs:85app.UseRequestLocalization()
  • Duplicated culture lists: Middleware/CultureMiddleware.cs:10, Controllers/CultureController.cs:10, Extensions/LocalizationExtensions.cs:7
Proposed fix
  1. Delete CultureMiddleware.cs.
  2. Expose one SupportedCultures constant (in LocalizationExtensions) and reference it from CultureController.
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.