Skip to content

Commit e1b6c79

Browse files
committed
fix(lib): set NeedsReview per-entry in autofix, not resource-wide
- Track added categories per entry (added_here) - Only mark the current entry as NeedsReview when it changed
1 parent 16d011e commit e1b6c79

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

langcodec/src/plural_rules.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,17 @@ pub fn autofix_fill_missing_from_other_resource(resource: &mut Resource) -> usiz
192192
}
193193
// Need an 'other' form to duplicate
194194
if let Some(other_val) = plural.forms.get(&PluralCategory::Other).cloned() {
195+
let mut added_here = 0usize;
195196
for cat in missing {
196197
// Insert only if still missing (avoid race with duplicates)
197198
if let std::collections::btree_map::Entry::Vacant(e) = plural.forms.entry(cat) {
198199
e.insert(other_val.clone());
199200
added += 1;
201+
added_here += 1;
200202
}
201203
}
202204
// Mark as needs review if anything was added
203-
if added > 0 && !matches!(entry.status, EntryStatus::NeedsReview) {
205+
if added_here > 0 && !matches!(entry.status, EntryStatus::NeedsReview) {
204206
entry.status = EntryStatus::NeedsReview;
205207
}
206208
}

0 commit comments

Comments
 (0)