Skip to content

Add Persian Subtitle Fixes plugin for SE5 - #305

Merged
niksedk merged 1 commit into
mainfrom
claude/se5-persian-errors
Oct 8, 2026
Merged

niksedk merged 1 commit into
mainfrom
claude/se5-persian-errors

Conversation

@niksedk

@niksedk niksedk commented Oct 8, 2026

Copy link
Copy Markdown
Member

Port of msasanmh's Persian Subtitle Fixes (source/PersianErrors) to the Subtitle Edit 5 plugin contract, with a new Avalonia UI.

What's new

  • Sidebar with 12 fix groups. Each group has an icon, a color, the author's Persian title, and a fix count. Click a row to turn the group on or off. The hover tooltip shows a description and a live example, and the example's result comes from the rules themselves.
  • Fix cards. Each card shows the line number, the time code, chips for the groups that changed the line, and the text before → after (right to left) with the changed characters highlighted. You can filter by group, search by text or line number, and use select all / none / invert.
  • Show hidden characters. ZWNJ (نیم‌فاصله) is drawn as ·, direction marks as RLE/RLM/..., and a changed line break as ↵.
  • Scope. Check all lines or only the lines selected in SE.
  • Apply and re-check + Undo, like ArteCheck. Enabled groups and options are remembered between runs.
  • Light and dark themes follow SE.

Behaviour

  • The 1,526 rules in multiple_replace.xml are unchanged and run in the same order.
  • Changes go back as subtitle.paragraphs (text only), so every format is kept. With an older SE, the plugin falls back to SubRip.
  • The rules expect \r\n, so text is converted for them and converted back. The line break style is kept, and the results are the same on macOS and Linux.
  • One fix to the rule loader: quotes are now escaped only in regex rules. Because of that escaping, the two " + ZWNJ plain rules never matched before.

Tests

se5/PersianErrors.Tests, 32 tests:

  • Rule loading
  • Every group's UI example
  • The README examples
  • Line break style
  • Diff segments
  • View model: response format, unselected fixes, legacy SubRip, settings round trip, apply/undo

Checking 1,000 lines takes about 0.3 s.

Workflow: persian-errors.yml (tag se5-persian-errors-vX.Y). Index entry follows after the first release run.

🤖 Generated with Claude Code

Port of msasanmh's Persian Subtitle Fixes (source/PersianErrors) to the
SE5 plugin contract with an Avalonia UI: 12 rule groups with icons,
Persian titles and live examples, per-line fix cards with highlighted
differences, group filter chips, search, hidden-character display
(ZWNJ, direction marks), selected-lines scope, apply and re-check, undo.

The 1,526 rules are unchanged and run in the same order. Lines are
returned as paragraphs, so every format is kept; line break style is
preserved. Plain rules no longer get quotes escaped (the two
quote + ZWNJ rules never matched before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@niksedk
niksedk merged commit cc2cbce into main Oct 8, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant