Skip to content

Keep the e in the singular of words ending in ches - #775

Open
alaminfirdows wants to merge 1 commit into
laravel:0.xfrom
alaminfirdows:fix-singular-of-ches-words
Open

alaminfirdows wants to merge 1 commit into
laravel:0.xfrom
alaminfirdows:fix-singular-of-ches-words

Conversation

@alaminfirdows

Copy link
Copy Markdown

"caches".singular() returned cach, and niches and avalanches lost their e the same way. Laravel returns cache, niche, and avalanche.

The pluralizer crate treats these like churches, so they are now irregular words.

The cases are in the inflect.rs unit tests. cargo test -p laravel-rust-core --all-features --lib passes.

@alaminfirdows
alaminfirdows marked this pull request as ready for review December 3, 2026 18:59

Copy link
Copy Markdown
Member

This is an automated, agent-powered review.

Confirmed. pluralizer singularizes every word ending in ches the way it does churches, so "caches".singular() is cach and "niches".singular() is nich. Besides direct calls to singular, an application hits this through resource routes: Route::resource("caches", ..) names its parameter {cach}. The PR's new cases fail on 0.x and pass on this branch.

  • Correcting the words before they reach pluralizer is the right place for this, since the bad singular comes from that crate's rules. The same rule also drops the e from headaches, earaches, toothaches, moustaches, cliches, quiches, creches, brioches, pastiches, and microfiches, so the list could cover more of them.
  • This overlaps with Keep uncountable words as they are in plural and singular #639, which replaces the pluralizer calls in inflect.rs with a small internal laravel-rust-inflect crate and drops pluralizer from laravel-rust-core, so pluralizer::add_irregular_rule here would no longer compile once both land. That crate already has an IRREGULAR table for words pluralizer gets wrong, which is the natural home for cache, niche, and avalanche, and it's shared with the #[model] macro. I'd land Keep uncountable words as they are in plural and singular #639 first and then move these words into that table, so I haven't pushed anything here.
  • No breaking changes, apart from resource parameters for these words changing from {cach} to {cache}.

Thanks for your contribution, a human review will follow shortly.

@taylorotwell taylorotwell added bug p3 Priority 3: lowest labels Dec 3, 2026 — with Amp for GitHub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug p3 Priority 3: lowest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants